Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

steering controller library (ackermann steering) does not publish odom TF #762

Closed
guidout opened this issue Sep 3, 2023 · 6 comments
Closed
Labels

Comments

@guidout
Copy link

guidout commented Sep 3, 2023

Describe the bug
I see the following topics:
/ackermann_steering_controller/controller_state
/ackermann_steering_controller/odometry
/ackermann_steering_controller/reference
/ackermann_steering_controller/tf_odometry
/ackermann_steering_controller/transition_event
but the odom transform is not being published.

Environment:

  • OS: Ubuntu 22.04
  • Version: Humble
@guidout guidout added the bug label Sep 3, 2023
@Corund060
Copy link

Corund060 commented Sep 20, 2023

/ackermann_steering_controller/tf_odometry is odom tf, you can remap it to /tf

@guidout
Copy link
Author

guidout commented Sep 20, 2023

I tried that but it doesn't seem to apply. Maybe I have an error in the launch file?
Here is how I'm launching the controller in my launch file:

ackermann_steering_controller_spawner = Node(
       package="controller_manager",
       executable="spawner",
       parameters=[{'use_sim_time': use_sim_time}],
       arguments=["ackermann_steering_controller"],
       remappings=[('ackermann_steering_controller/tf_odometry','tf')],
       condition= IfCondition(LaunchConfiguration('use_ackermann_controller'))
    )

@Corund060
Copy link

Corund060 commented Sep 20, 2023

You are remapping in the wrong place. You have to do it for ros2_control not for the spawner. I did this in model urdf and it worked: <gazebo> <plugin filename="libgazebo_ros2_control.so" name="gazebo_ros2_control"> <ros> <namespace></namespace> <remapping>ackermann_steering_controller/reference_unstamped:=cmd_vel</remapping> <remapping>ackermann_steering_controller/odometry:=odom</remapping> <remapping>ackermann_steering_controller/tf_odometry:=tf</remapping> </ros> <parameters>your_pkg/config/controller_configuration.yaml</parameters> </plugin> </gazebo>

@guidout
Copy link
Author

guidout commented Sep 21, 2023

yes! that worked. Thank you so much.
Now that works for simulation, for the real robot I guess I have to had the remappings in ros2_control node like below, right?

controller_manager = Node(
        package="controller_manager",
        executable="ros2_control_node",
        parameters=[{'robot_description': robot_description},
                    controls_params_file,
                    controls_rear_wheels_params_file,
                    {'use_sim_time': use_sim_time}],
        remappings=[('ackermann_steering_controller/tf_odometry','tf')],
        condition= UnlessCondition(use_sim_time)
    )

@Corund060
Copy link

This should work. Haven't tested it myself though.

@christophfroehlich
Copy link
Contributor

Yes this should be fine, see this example here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants