Skip to content

Commit

Permalink
Merge branch 'mjcarroll/sdf'
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <michael@openrobotics.org>
  • Loading branch information
mjcarroll committed Oct 19, 2022
2 parents ee53768 + 44a8857 commit 573d847
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 42 deletions.
10 changes: 0 additions & 10 deletions ros_gz_example_bringup/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@ project(ros_gz_example_bringup)

find_package(ament_cmake REQUIRED)

find_package(gz-cmake3 REQUIRED)
find_package(gz-plugin2 REQUIRED COMPONENTS register)
set(GZ_PLUGIN_VER ${gz-plugin2_VERSION_MAJOR})
find_package(gz-common5 REQUIRED COMPONENTS profiler)
set(GZ_COMMON_VER ${gz-common5_VERSION_MAJOR})
find_package(gz-sim7 REQUIRED)
set(GZ_SIM_VER ${gz-sim7_VERSION_MAJOR})

find_package(sdformat_urdf)

# Install project launch files
install(
DIRECTORY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ Panels:
Expanded:
- /Global Options1
- /Status1
- /Grid1
- /RobotModel1
- /RobotModel1/Status1
- /RobotModel1/Links1
Splitter Ratio: 0.5
Tree Height: 555
Tree Height: 719
- Class: rviz_common/Selection
Name: Selection
- Class: rviz_common/Tool Properties
Expand All @@ -29,7 +25,7 @@ Panels:
Experimental: false
Name: Time
SyncMode: 0
SyncSource: ""
SyncSource: LaserScan
Visualization Manager:
Class: ""
Displays:
Expand Down Expand Up @@ -102,6 +98,79 @@ Visualization Manager:
Update Interval: 0
Value: true
Visual Enabled: true
- Angle Tolerance: 0.10000000149011612
Class: rviz_default_plugins/Odometry
Covariance:
Orientation:
Alpha: 0.5
Color: 255; 255; 127
Color Style: Unique
Frame: Local
Offset: 1
Scale: 1
Value: true
Position:
Alpha: 0.30000001192092896
Color: 204; 51; 204
Scale: 1
Value: true
Value: true
Enabled: true
Keep: 100
Name: Odometry
Position Tolerance: 0.10000000149011612
Shape:
Alpha: 1
Axes Length: 1
Axes Radius: 0.10000000149011612
Color: 255; 25; 0
Head Length: 0.30000001192092896
Head Radius: 0.10000000149011612
Shaft Length: 1
Shaft Radius: 0.05000000074505806
Value: Arrow
Topic:
Depth: 5
Durability Policy: Volatile
Filter size: 10
History Policy: Keep Last
Reliability Policy: Reliable
Value: /diff_drive/odometry
Value: true
- Alpha: 1
Autocompute Intensity Bounds: true
Autocompute Value Bounds:
Max Value: 10
Min Value: -10
Value: true
Axis: Z
Channel Name: intensity
Class: rviz_default_plugins/LaserScan
Color: 255; 255; 255
Color Transformer: Intensity
Decay Time: 0
Enabled: true
Invert Rainbow: false
Max Color: 255; 255; 255
Max Intensity: -999999
Min Color: 0; 0; 0
Min Intensity: 999999
Name: LaserScan
Position Transformer: XYZ
Selectable: true
Size (Pixels): 3
Size (m): 0.009999999776482582
Style: Flat Squares
Topic:
Depth: 5
Durability Policy: Volatile
Filter size: 10
History Policy: Keep Last
Reliability Policy: Reliable
Value: /diff_drive/scan
Use Fixed Frame: true
Use rainbow: true
Value: true
Enabled: true
Global Options:
Background Color: 48; 48; 48
Expand Down Expand Up @@ -148,7 +217,7 @@ Visualization Manager:
Views:
Current:
Class: rviz_default_plugins/Orbit
Distance: 10
Distance: 24.40549659729004
Enable Stereo Rendering:
Stereo Eye Separation: 0.05999999865889549
Stereo Focal Distance: 1
Expand All @@ -171,10 +240,10 @@ Visualization Manager:
Window Geometry:
Displays:
collapsed: false
Height: 846
Height: 1016
Hide Left Dock: false
Hide Right Dock: false
QMainWindow State: 000000ff00000000fd0000000400000000000002d8000002b4fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003b000002b4000000c700fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f000002b4fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003b000002b4000000a000fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004b00000003efc0100000002fb0000000800540069006d00650100000000000004b00000025300fffffffb0000000800540069006d00650100000000000004500000000000000000000000bd000002b400000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
QMainWindow State: 000000ff00000000fd0000000400000000000001560000035afc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d0000035a000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f0000035afc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003d0000035a000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000007360000003efc0100000002fb0000000800540069006d0065010000000000000736000002fb00fffffffb0000000800540069006d00650100000000000004500000000000000000000004c50000035a00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
Selection:
collapsed: false
Time:
Expand All @@ -183,6 +252,6 @@ Window Geometry:
collapsed: false
Views:
collapsed: false
Width: 1200
X: 72
Y: 60
Width: 1846
X: 74
Y: 27
17 changes: 11 additions & 6 deletions ros_gz_example_bringup/config/ros_gz_example_bridge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,23 @@
ros_type_name: "sensor_msgs/msg/LaserScan"
gz_type_name: "gz.msgs.LaserScan"
direction: GZ_TO_ROS
- ros_topic_name: "/world/demo/model/diff_drive"
gz_topic_name: "/joint_state"
- ros_topic_name: "/clock"
gz_topic_name: "/clock"
ros_type_name: "rosgraph_msgs/msg/clock"
gz_type_name: "gz.msgs.Clock"
direction: GZ_TO_ROS
- ros_topic_name: "/joint_states"
gz_topic_name: "/world/demo/model/diff_drive/joint_state"
ros_type_name: "sensor_msgs/msg/JointState"
gz_type_name: "gz.msgs.Model"
direction: GZ_TO_ROS
- ros_topic_name: "/model/diff_drive/"
gz_topic_name: "/pose"
- ros_topic_name: "/tf"
gz_topic_name: "/model/diff_drive/pose"
ros_type_name: "tf2_msgs/msg/TFMessage"
gz_type_name: "gz.msgs.Pose_V"
direction: GZ_TO_ROS
- ros_topic_name: "/model/diff_drive/"
gz_topic_name: "/pose_static"
- ros_topic_name: "/tf_static"
gz_topic_name: "/model/diff_drive/pose_static"
ros_type_name: "tf2_msgs/msg/TFMessage"
gz_type_name: "gz.msgs.Pose_V"
direction: GZ_TO_ROS
Expand Down
24 changes: 11 additions & 13 deletions ros_gz_example_bringup/launch/diff_drive.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,13 @@ def generate_launch_description():
pkg_project_bringup = get_package_share_directory('ros_gz_example_bringup')
pkg_project_gazebo = get_package_share_directory('ros_gz_example_gazebo')
pkg_project_description = get_package_share_directory('ros_gz_example_description')
pkg_ros_gz_sim = get_package_share_directory('ros_gz_sim')

# Load the SDF file from "description" package
sdf_file = os.path.join(pkg_project_description, 'models', 'diff_drive', 'model.sdf')

with open(sdf_file, 'r') as infp:
robot_desc = infp.read()

pkg_ros_gz_sim = get_package_share_directory('ros_gz_sim')

gz_sim = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_ros_gz_sim, 'launch', 'gz_sim.launch.py')),
Expand All @@ -59,26 +58,25 @@ def generate_launch_description():
]
)

# RViz
rviz = Node(
package='rviz2',
executable='rviz2',
arguments=['-d', os.path.join(pkg_project_bringup, 'config', 'diff_drive.rviz')],
condition=IfCondition(LaunchConfiguration('rviz'))
)

# Bridge
bridge = Node(
package='ros_gz_bridge',
executable='parameter_bridge',
parameters=[{
'config_file': os.path.join(pkg_project_bringup, 'config', 'ros_gz_example_bridge.yaml'),
'qos_overrides./model/diff_drive.subscriber.reliability': 'reliable',
'qos_overrides./tf_static.publisher.durability': 'transient_local',
}],
output='screen'
)

# RViz
rviz = Node(
package='rviz2',
executable='rviz2',
arguments=['-d', os.path.join(pkg_project_bringup, 'rviz', 'diff_drive.rviz')],
condition=IfCondition(LaunchConfiguration('rviz'))
)


return LaunchDescription([
gz_sim,
DeclareLaunchArgument('rviz', default_value='true',
Expand Down
1 change: 1 addition & 0 deletions ros_gz_example_description/models/diff_drive/model.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
<sensor name='gpu_lidar' type='gpu_lidar'>
<pose>0 0 0 0 0 0</pose>
<topic>scan</topic>
<ignition_frame_id>diff_drive/lidar_link</ignition_frame_id>
<update_rate>10</update_rate>
<lidar>
<scan>
Expand Down
1 change: 0 additions & 1 deletion ros_gz_example_gazebo/worlds/diff_drive.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
filename="gz-sim-user-commands-system"
name="gz::sim::systems::UserCommands">
</plugin>

<plugin
filename="BasicSystem"
name="ros_gz_example_gazebo::BasicSystem">
Expand Down

0 comments on commit 573d847

Please sign in to comment.