Closed haavarpb closed 1 year ago
Hi @haavarpb. I can replicate the issue. It appears that recent changes to the remapping of tf
generated by robot_state_publisher
and ros_gz_bridge
and the dropping of tf_prefix
is causing this issue. Will work on a fix.
Some further details on why the odom -> base_link
TF has been lost and what needs to happen to re-enable it.
base_link
and that there should be a continuous in time transform from the frame odom
: odom -> base_link
.gz::sim::systems::OdometryPublisher
. The system publishes the pose from the frame given in <odom_frame>
to <robot_base_frame>
then adds to the poses published to the topic /model/{model_name}/pose
. The initial version (15fb43c) uses TF prefixes and set the robot base to be the name given to the model in the world file, however this does not conform to REP 105.Change required: modify the plugin XML in the model.sdf
files to:
<plugin
filename="gz-sim-odometry-publisher-system"
name="gz::sim::systems::OdometryPublisher">
<odom_frame>odom</odom_frame>
<robot_base_frame>base_link</robot_base_frame>
<dimensions>3</dimensions>
</plugin>
ros_gz_bridge
to build the TF tree. The TF from the robot_state_publisher
is mapped to /ignore/tf
to avoid conflicts. The TF also used a prefix iris
.robot_state_publisher
as the authority for TF. It obtains the joint state data from the /joint_states
topic published by ros_gz_bridge
, however this does not include odometry. No TF prefix is used.Change required: we need to extract the TF odom -> base_link
from /gz/tf
and publish to tf
. This will require a message filter of some sort.
topic_tools transform
will do:
ros2 run topic_tools transform /gz/tf /tf tf2_msgs/msg/TFMessage "tf2_msgs.msg.TFMessage(transforms=[x for x in m.transforms if x.header.frame_id == 'odom'])" --import tf2_msgs geometry_msgs
The remaining issue to resolve is to remove any messages containing an empty transform from the filtered output as this causes the following warning in AP_DDS
:
--sitl 127.0.0.1:5501 --non-interactive -5] AP: Received tf2_msgs/TFMessage: Insufficient size
Figure: resulting TF tree with topic_tools transform filter
Hi,
when I do
ros2 launch ardupilot_gz_bringup iris_runway.launch.py
I get spammed by rviz with this message:Also, RVIZ starts misconfigured:
I could fix this by updating the Global Options Fixed Frame from
iris/odom
tobase_link
, and removing the Robot Model TF Prefix fromiris
to empty:After this change the aforementioned spamming continues, but with a different message
Either the .rviz-config file is not set up correctly or some topics are incorrectly mapped.