forked from gazebosim/ros_gz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Testing launch with gz_server and ros_gz_bridge composable nodes
Signed-off-by: Addisu Z. Taddese <[email protected]>
- Loading branch information
Showing
11 changed files
with
224 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
- topic_name: "/imu" | ||
ros_type_name: "sensor_msgs/msg/Imu" | ||
gz_type_name: "gz.msgs.IMU" | ||
direction: GZ_TO_ROS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
|
||
# - ros_topic_name: "/camera/image" | ||
# gz_topic_name: "/camera" | ||
# ros_type_name: "sensor_msgs/msg/Image" | ||
# gz_type_name: "gz.msgs.Image" | ||
# direction: GZ_TO_ROS | ||
# | ||
# - ros_topic_name: "/camera/camera_info" | ||
# gz_topic_name: "/camera_info" | ||
# ros_type_name: "sensor_msgs/msg/Image" | ||
# gz_type_name: "gz.msgs.Image" | ||
# direction: GZ_TO_ROS | ||
# | ||
# - topic_name: "/rgbd_camera/image" | ||
# ros_type_name: "sensor_msgs/msg/Image" | ||
# gz_type_name: "gz.msgs.Image" | ||
# direction: GZ_TO_ROS | ||
# | ||
# - topic_name: "/rgbd_camera/camera_info" | ||
# ros_type_name: "sensor_msgs/msg/CameraInfo" | ||
# gz_type_name: "gz.msgs.CameraInfo" | ||
# direction: GZ_TO_ROS | ||
# | ||
# - topic_name: "/rgbd_camera/depth_image" | ||
# ros_type_name: "sensor_msgs/msg/Image" | ||
# gz_type_name: "gz.msgs.Image" | ||
# direction: GZ_TO_ROS | ||
|
||
- topic_name: "/rgbd_camera/points" | ||
ros_type_name: "sensor_msgs/msg/PointCloud2" | ||
gz_type_name: "gz.msgs.PointCloudPacked" | ||
direction: GZ_TO_ROS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright 2019 Open Source Robotics Foundation, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import os | ||
|
||
from ament_index_python.packages import get_package_share_directory | ||
|
||
from launch import LaunchDescription | ||
from launch.actions import DeclareLaunchArgument | ||
from launch.actions import IncludeLaunchDescription | ||
from launch.launch_description_sources import PythonLaunchDescriptionSource | ||
|
||
|
||
def generate_launch_description(): | ||
|
||
pkg_ros_gz_sim = get_package_share_directory('ros_gz_sim') | ||
pkg_ros_gz_sim_demos = get_package_share_directory('ros_gz_sim_demos') | ||
|
||
gz_sim = IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource( | ||
os.path.join(pkg_ros_gz_sim, 'launch', 'ros_gz_sim.launch.py')), | ||
launch_arguments={ | ||
'world_sdf_file': 'sensors.sdf', | ||
'config_file': os.path.join(pkg_ros_gz_sim_demos, | ||
'config', 'imu.yaml'), | ||
}.items(), | ||
) | ||
|
||
return LaunchDescription([ | ||
gz_sim, | ||
DeclareLaunchArgument( | ||
'rviz', default_value='true', description='Open RViz.' | ||
), | ||
# rviz | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
ros_gz_sim_demos/launch/rgbd_camera_bridge_composition.launch.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Copyright 2019 Open Source Robotics Foundation, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import os | ||
|
||
from ament_index_python.packages import get_package_share_directory | ||
|
||
from launch import LaunchDescription | ||
from launch.actions import DeclareLaunchArgument | ||
from launch.actions import IncludeLaunchDescription | ||
from launch.conditions import IfCondition | ||
from launch.launch_description_sources import PythonLaunchDescriptionSource | ||
from launch.substitutions import LaunchConfiguration | ||
|
||
from launch_ros.actions import Node | ||
|
||
|
||
def generate_launch_description(): | ||
|
||
pkg_ros_gz_sim_demos = get_package_share_directory('ros_gz_sim_demos') | ||
pkg_ros_gz_sim = get_package_share_directory('ros_gz_sim') | ||
|
||
gz_sim = IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource( | ||
os.path.join(pkg_ros_gz_sim, 'launch', 'ros_gz_sim.launch.py')), | ||
launch_arguments={ | ||
'world_sdf_file': 'sensors_demo.sdf', | ||
'config_file': os.path.join(pkg_ros_gz_sim_demos, | ||
'config', 'rgbd_camera_bridge.yaml'), | ||
}.items(), | ||
) | ||
|
||
# RViz | ||
rviz = Node( | ||
package='rviz2', | ||
executable='rviz2', | ||
arguments=[ | ||
'-d', os.path.join(pkg_ros_gz_sim_demos, 'rviz', 'rgbd_camera_bridge.rviz') | ||
], | ||
condition=IfCondition(LaunchConfiguration('rviz')) | ||
) | ||
|
||
return LaunchDescription([ | ||
gz_sim, | ||
DeclareLaunchArgument('rviz', default_value='true', | ||
description='Open RViz.'), | ||
rviz, | ||
]) |