As reported in #30, rviz is reporting an invalid TF error when running the examples from the README page. The issue applies to both the iris_runway.launch.py and iris_maze.launch.py examples.
The reasons are explained in: https://github.com/ArduPilot/ardupilot_gz/issues/30#issuecomment-1721549208. In brief the change to use the robot_state_publisher as the authority for TF and remove the TF prefix means that the transform from odom to base_link provided by the Gazebo OdometryPublisher is no longer published to the topic /tf.
The following changes fix the issue:
Change the frame names used in the copter model plugin XML for OdometryPublisher.
Add a topic_tools node to transform the /gz/tf topic published by the ros_gz_bridge. The transform selects only the transform from odom -> base_link and publishes to /tf.
Remove the TF Prefix in rviz and update the fixed frame to odom.
Other changes:
Display the laser scan in rviz
Testing
Both launch files are tested and the node graph, TF, and rviz are provided for each:
iris_runway.launch.py
iris_maze.launch.py
Other issues
A side-effect of the topic_toolstransform is that occasionally an empty transform array will be published to /tf. Ardupilot AP_DDS currently reports a warning if the TF message is empty. The further items to resolve are:
Fix the topics_tools node to only publish when the transform is not empty.
Configure the reporting in AP_DDS.
Configure whether AP_DDS subscribes to /tf (it should not necessarily always be doing so).
Fix the odometry transform for both copter examples.
Dependencies
Details
As reported in #30, rviz is reporting an invalid TF error when running the examples from the README page. The issue applies to both the
iris_runway.launch.py
andiris_maze.launch.py
examples.The reasons are explained in: https://github.com/ArduPilot/ardupilot_gz/issues/30#issuecomment-1721549208. In brief the change to use the
robot_state_publisher
as the authority for TF and remove the TF prefix means that the transform fromodom
tobase_link
provided by the GazeboOdometryPublisher
is no longer published to the topic/tf
.The following changes fix the issue:
OdometryPublisher
.topic_tools
node to transform the/gz/tf
topic published by theros_gz_bridge
. The transform selects only the transform fromodom -> base_link
and publishes to/tf
.odom
.Other changes:
Testing
Both launch files are tested and the node graph, TF, and rviz are provided for each:
iris_runway.launch.py
iris_maze.launch.py
Other issues
A side-effect of the
topic_tools
transform
is that occasionally an empty transform array will be published to/tf
. ArdupilotAP_DDS
currently reports a warning if the TF message is empty. The further items to resolve are:topics_tools
node to only publish when the transform is not empty.AP_DDS
.AP_DDS
subscribes to/tf
(it should not necessarily always be doing so).