Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor air pressure demo #632

Open
wants to merge 11 commits into
base: ros2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ros_gz_sim_demos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ if(BUILD_TESTING)
ament_lint_auto_find_test_dependencies()
endif()

install(
DIRECTORY
config/
DESTINATION share/${PROJECT_NAME}/config
)

install(
DIRECTORY
launch/
Expand Down
11 changes: 3 additions & 8 deletions ros_gz_sim_demos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,12 @@ There's a convenient launch file, try for example:

Publishes fluid pressure readings.

ros2 launch ros_gz_sim_demos air_pressure.launch.py
ros2 launch ros_gz_sim_demos air_pressure.launch.xml

This demo also shows the use of custom QoS parameters. The sensor data is
published as as "best-effort", so trying to subscribe to "reliable" data won't
work. See the difference between:
You can subscribe to receive the data with:

ros2 topic echo /air_pressure --qos-reliability best_effort
ros2 topic echo /air_pressure

And

ros2 topic echo /air_pressure --qos-reliability reliable

![](images/air_pressure_demo.png)

Expand Down
9 changes: 9 additions & 0 deletions ros_gz_sim_demos/config/air_pressure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Air pressure bridge configuration.
- ros_topic_name: "air_pressure"
gz_topic_name: "air_pressure"
ros_type_name: "sensor_msgs/msg/FluidPressure"
gz_type_name: "gz.msgs.FluidPressure"
subscriber_queue: 5
publisher_queue: 6
lazy: false
direction: GZ_TO_ROS
63 changes: 0 additions & 63 deletions ros_gz_sim_demos/launch/air_pressure.launch.py

This file was deleted.

6 changes: 6 additions & 0 deletions ros_gz_sim_demos/launch/air_pressure.launch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<launch>
<gz_server world_sdf_file="sensors.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/air_pressure.yaml" use_composition="True" />
<node pkg="rqt_topic" exec="rqt_topic"/>
<executable cmd="gz sim -g"/>
</launch>