Closed maarufvazifdar closed 2 years ago
I have the same problem. Have you solved it?
@arubenecia @jd-deleon can you take a look?
By the way, these tutorials were written for Galactic and newer. I'm not sure if that has anything to do with the issues you're seeing, but just giving you that heads up.
We did not notice this when making the tutorial but upon checking, we also encountered the same problem on Galactic.
We have observed that data is being published on /odometry/filtered
and /accel/filtered
after setting ekf_node
's use_sim_time
to false
(https://github.com/ros-planning/navigation2_tutorials/blob/master/sam_bot_description/launch/display.launch.py#L41).
But doing this causes outdated odom
->base_link
transform by the ekf_node
(TF_OLD_DATA error shows for base_link
).
Since odom
->base_link
transform is already being published by Gazebo's differential drive plugin, we set ekf_node
's publish_tf
to false
(https://github.com/ros-planning/navigation2_tutorials/blob/master/sam_bot_description/config/ekf.yaml#L19) to solve the TF_OLD_DATA error.
After setting use_sim_time
and publish_tf
of ekf_node
to false, the data are are now being published on /odometry/filtered
and /accel/filtered
We are not yet sure what is the cause of the problem but we will look into this more next week.
We did not notice this when making the tutorial but upon checking, we also encountered the same problem on Galactic.
We have observed that data is being published on
/odometry/filtered
and/accel/filtered
after settingekf_node
'suse_sim_time
tofalse
(https://github.com/ros-planning/navigation2_tutorials/blob/master/sam_bot_description/launch/display.launch.py#L41).But doing this causes outdated
odom
->base_link
transform by theekf_node
(TF_OLD_DATA error shows forbase_link
). Sinceodom
->base_link
transform is already being published by Gazebo's differential drive plugin, we setekf_node
'spublish_tf
tofalse
(https://github.com/ros-planning/navigation2_tutorials/blob/master/sam_bot_description/config/ekf.yaml#L19) to solve the TF_OLD_DATA error.After setting
use_sim_time
andpublish_tf
ofekf_node
to false, the data are are now being published on/odometry/filtered
and/accel/filtered
We are not yet sure what is the cause of the problem but we will look into this more next week.
ok, thanks. I do some log and find that in ros_filter.cpp the code can not run into the function periodicUpdate, take it a step further the GenericTimer seems not work properly. Is that caused by the parameter use_sim_time?
Is that caused by the parameter use_sim_time?
In Foxy, if use_sim_time
is set to true, but nothing is getting published on /clock
, then the node will hang indefinitely. I am not familiar with this tutorial, so this might be something else.
That makes sense
Is that caused by the parameter use_sim_time?
In Foxy, if
use_sim_time
is set to true, but nothing is getting published on/clock
, then the node will hang indefinitely. I am not familiar with this tutorial, so this might be something else.
Thank you. It turns out that Gazebo is not publishing to /clock
.
@maarufvazifdar @WUyinwei-hah The problem was fixed by loading the gazebo_ros_init
plugin which publishes the Gazebo simulation time to /clock
.
Please try loading the gazebo_ros_init
by changing line https://github.com/ros-planning/navigation2_tutorials/blob/master/sam_bot_description/launch/display.launch.py#L53 to launch.actions.ExecuteProcess(cmd=['gazebo', '-s', 'libgazebo_ros_init.so', '-s', 'libgazebo_ros_factory.so', world_path], output='screen'),
The world_path
was added in the next tutorial, 'Setting Up Sensors', so you can remove world_path
in the line if you have not applied the changes in that tutorial to display.launch.py
yet.
Also no need to change use_sim_time
and publish_tf
of ekf_node
to false.
We'll file PR for the changes in the tutorial and source code.
@SteveMacenski We are also thinking of setting the differential drive plugin's <publish_odom_tf>
to false since we already set publish_tf
of ekf_node
to true. We will include this in the PR if you agree.
Is that caused by the parameter use_sim_time?
In Foxy, if
use_sim_time
is set to true, but nothing is getting published on/clock
, then the node will hang indefinitely. I am not familiar with this tutorial, so this might be something else.Thank you. It turns out that Gazebo is not publishing to
/clock
.@maarufvazifdar @WUyinwei-hah The problem was fixed by loading the
gazebo_ros_init
plugin which publishes the Gazebo simulation time to/clock
.Please try loading the
gazebo_ros_init
by changing line https://github.com/ros-planning/navigation2_tutorials/blob/master/sam_bot_description/launch/display.launch.py#L53 tolaunch.actions.ExecuteProcess(cmd=['gazebo', '-s', 'libgazebo_ros_init.so', '-s', 'libgazebo_ros_factory.so', world_path], output='screen'),
The
world_path
was added in the next tutorial, 'Setting Up Sensors', so you can removeworld_path
in the line if you have not applied the changes in that tutorial todisplay.launch.py
yet.Also no need to change
use_sim_time
andpublish_tf
ofekf_node
to false.We'll file PR for the changes in the tutorial and source code.
@SteveMacenski We are also thinking of setting the differential drive plugin's
<publish_odom_tf>
to false since we already setpublish_tf
ofekf_node
to true. We will include this in the PR if you agree.
Thanks for your work!
Please do!
I was following the turorial to try ekf on ros2 foxy. On launching
display.launch.py
bot spawned in gazebo and rviz, and I can see the ekf topics but on echoing/odometry/filtered
there is no message being published. I checked and there is data is getting published on/demo/odom
and/demo/imu
.I am running Ubuntu 20.04 and ros-foxy.
Here are the published topics:
Ekf node info:
Launch log:
Please let me know if more information is required about the issue. @SteveMacenski