I'm trying to simulate the movement my robot in Ignition Gazebo 6, and configured the DiffDriveController following ros2_control_demos.
After the nodes are launched, I found the odom is not always published (Sometimes published, but most time not).
I checked the diff_drive_controller.cpp and added some printout, find that previous_publish_timestamp_ = get_node()->get_clock()->now(); sometimes can't get the sim time, but rather get the timestamp in Rviz (1.67733e+09).
In the update() function, the odom will be published only if previous_publish_timestamp_ + publish_period_ < time where "time" is passed in as sim time.
I set use_sim_time to be true in the launch file using
Hi,
I'm trying to simulate the movement my robot in Ignition Gazebo 6, and configured the DiffDriveController following ros2_control_demos.
After the nodes are launched, I found the odom is not always published (Sometimes published, but most time not). I checked the diff_drive_controller.cpp and added some printout, find that
previous_publish_timestamp_ = get_node()->get_clock()->now();
sometimes can't get the sim time, but rather get the timestamp in Rviz (1.67733e+09).In the update() function, the odom will be published only if
previous_publish_timestamp_ + publish_period_ < time
where "time" is passed in as sim time.I set use_sim_time to be true in the launch file using
The console output did have "Setting use_sim_time=True for diff_drive_base_controller":
The strange thing is that this not always happens, sometimes it did get the sim time and publish odom.
Environment: ubuntu 22.04, ros2 humble, Ignition Gazebo 6.11.0
Thanks for any help! Jia