0
$\begingroup$

I cannot set odom as a fixed frame inside RViz. It doesn't show up at all. My robot is fully functional and visible in both Gazebo. I don't get any warnings, errors or exceptions in the log. I'm using ROS2 Humble and Gazebo Fortress. I follow the code of the tricycle_drive_example from ign_ros2_control_demos (which publishes odom correctly if I run it on my laptop).

As intended by the controller, the topic /ackermann_steering_cotroller/odometry is published. Whenerver I try to visualize that topic with RViz, I get the following message:

[INFO] [1704543459.237610775] [rviz]: Message Filter dropping message: frame 'odom' at time 214,560 for reason 'discarding message because the queue is full'

Running ros2 run tf2_ros tf2_echo odom base_link, gives this:

[INFO] [1704543792.043830485] [tf2_echo]: Waiting for transform odom ->  base_link: Invalid frame ID "odom" passed to canTransform argument target_frame - frame does not exist

Also, my tf_tree looks like this: enter image description here

The ros2_control tag inside my urdf:

<ros2_control name="IgnitionSystem" type="system">
    <hardware>
        <plugin>ign_ros2_control/IgnitionSystem</plugin>
    </hardware>
    <joint name="LEFT_HINGE_JOINT">
        <command_interface name="position"/>
        <state_interface name="position"/>
    </joint>
    <joint name="RIGHT_HINGE_JOINT">
        <command_interface name="position"/>
        <state_interface name="position"/>
    </joint>
    <joint name="LEFT_REAR_WHEEL_JOINT">
        <command_interface name="velocity"/>
        <state_interface name="velocity"/>
        <state_interface name="position"/>
    </joint>
    <joint name="RIGHT_REAR_WHEEL_JOINT">
        <command_interface name="velocity"/>
        <state_interface name="velocity"/>
        <state_interface name="position"/>
    </joint>
</ros2_control>

The configuration file for the controllers:

controller_manager:
  ros__parameters:
    update_rate: 50

    joint_state_broadcaster:
      type: joint_state_broadcaster/JointStateBroadcaster

    ackermann_steering_controller:
      type: ackermann_steering_controller/AckermannSteeringController

joint_state_broadcaster:
  ros__parameters:
  extra_joints: ["RIGHT_FRONT_WHEEL_JOINT", "LEFT_FRONT_WHEEL_JOINT"]

ackermann_steering_controller:
  ros__parameters:

    reference_timeout: 2.0
    front_steering: true
    open_loop: false
    velocity_rolling_window_size: 10
    use_stamped_vel: false
    rear_wheels_names: [RIGHT_REAR_WHEEL_JOINT, LEFT_REAR_WHEEL_JOINT]
    front_wheels_names: [RIGHT_HINGE_JOINT, LEFT_HINGE_JOINT]
    odom_frame_id: odom
    base_frame_id: base_link
    enable_odom_tf: true
    odom_only_twist: false

    wheelbase: 0.324
    front_wheel_track: 0.387
    rear_wheel_track: 0.387
    front_wheels_radius: 0.055
    rear_wheels_radius: 0.055

In addition, here is what's on the log:

[ruby $(which ign) gazebo-2] [INFO] [1704582360.211746217] [controller_manager]: Loading controller 'ackermann_steering_controller'
[ruby $(which ign) gazebo-2] [INFO] [1704582360.222413325] [controller_manager]: Setting use_sim_time=True for ackermann_steering_controller to match controller manager (see ros2_control#325 for details)
[spawner-7] [INFO] [1704582360.288968173] [spawner_ackermann_steering_controller]: Loaded ackermann_steering_controller
[ruby $(which ign) gazebo-2] [INFO] [1704582360.290052009] [controller_manager]: Configuring controller 'ackermann_steering_controller'
[ruby $(which ign) gazebo-2] [INFO] [1704582360.290166991] [ackermann_steering_controller]: ackermann odom configure successful
[ruby $(which ign) gazebo-2] [INFO] [1704582360.295780665] [ackermann_steering_controller]: configure successful
[spawner-7] [INFO] [1704582360.569778822] [spawner_ackermann_steering_controller]: Configured and activated ackermann_steering_controller
[INFO] [spawner-7]: process has finished cleanly [pid 51038]
$\endgroup$

1 Answer 1

0
$\begingroup$

Be aware that tricycle_controller has a totally different codebase then the ackermann_steering_controller (which uses the same base as bicycle_steering_controller and tricycle_steering_controller, see steering_controller_library): You cannot use the configuration directly.

Does this note here maybe fix your problem?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.