Skip to content

Commit

Permalink
Refactor tf_bridge demo (#644)
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Agüero <[email protected]>
  • Loading branch information
caguero authored Dec 13, 2024
1 parent e1f578a commit f9e5409
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 60 deletions.
2 changes: 1 addition & 1 deletion ros_gz_sim_demos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,6 @@ and transforms of a robot in rviz.

To try the demo launch:

ros2 launch ros_gz_sim_demos tf_bridge.launch.py
ros2 launch ros_gz_sim_demos tf_bridge.launch.xml

![](images/tf_bridge.gif)
14 changes: 14 additions & 0 deletions ros_gz_sim_demos/config/tf_bridge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# tf_bridge configuration.
- ros_topic_name: "/joint_states"
gz_topic_name: "/world/default/model/double_pendulum_with_base0/joint_state"
ros_type_name: "sensor_msgs/msg/JointState"
gz_type_name: "gz.msgs.Model"
lazy: true
direction: GZ_TO_ROS

- ros_topic_name: "/tf"
gz_topic_name: "/model/double_pendulum_with_base0/pose"
ros_type_name: "tf2_msgs/msg/TFMessage"
gz_type_name: "gz.msgs.Pose_V"
lazy: true
direction: GZ_TO_ROS
59 changes: 0 additions & 59 deletions ros_gz_sim_demos/launch/tf_bridge.launch.py

This file was deleted.

12 changes: 12 additions & 0 deletions ros_gz_sim_demos/launch/tf_bridge.launch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<launch>
<gz_server
world_sdf_file="$(find-pkg-share ros_gz_sim_demos)/models/double_pendulum_model.sdf"
use_composition="True"
create_own_container="True" />
<ros_gz_bridge
bridge_name="ros_gz_bridge"
config_file="$(find-pkg-share ros_gz_sim_demos)/config/tf_bridge.yaml"
use_composition="True" />
<node pkg="rviz2" exec="rviz2" args="-d $(find-pkg-share ros_gz_sim_demos)/rviz/tf_bridge.rviz" />
<executable cmd="gz sim -g" />
</launch>

0 comments on commit f9e5409

Please sign in to comment.