-
Notifications
You must be signed in to change notification settings - Fork 188
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
Update Example 9 to use Gazebo Sim and .xml launch files #486
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<!-- | ||
Copyright (c) 2024, Stogl Robotics Consulting UG (haftungsbeschränkt) | ||
|
||
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. | ||
|
||
|
||
Source of this file are templates in [RosTeamWorkspace](https://github.com/StoglRobotics/ros_team_workspace) repository. | ||
|
||
Author: Dr. Denis | ||
--> | ||
|
||
<launch> | ||
<arg name="gui" | ||
default="false" | ||
description="Start RViz2 automatically with this launch file."/> | ||
|
||
<!-- Load description and start controllers --> | ||
<let name="robot_description_content" value="$(command '$(find-exec xacro) $(find-pkg-share ros2_control_demo_example_9)/urdf/rrbot.urdf.xacro use_gazebo_sim:=true')" /> | ||
|
||
<node pkg="robot_state_publisher" exec="robot_state_publisher" output="both"> | ||
<param name="robot_description" value="$(var robot_description_content)" /> | ||
<param name="use_sim_time" value="true" /> | ||
</node> | ||
|
||
<!-- Start Gazebo --> | ||
<let name="gazebo_world" value="$(find-pkg-share ros2_control_demo_example_9)/worlds/empty.world" /> | ||
<include file="$(find-pkg-share ros_gz_sim)/launch/gz_sim.launch.py" > | ||
<arg name="gz_args" value=" -r -v 4 $(var gazebo_world)"/> | ||
</include> | ||
|
||
<node pkg="ros_gz_bridge" exec="parameter_bridge" args=" | ||
/clock@rosgraph_msgs/msg/Clock[ignition.msgs.Clock" | ||
output="screen"> | ||
</node> | ||
|
||
<!-- Create robot in Gazebo --> | ||
<node pkg="ros_gz_sim" exec="create" output="screen" args="-topic /robot_description"/> | ||
|
||
<!-- Start Controllers --> | ||
<!--joint_state_braodcaster_spawner--> | ||
<node pkg="controller_manager" exec="spawner" args="joint_state_broadcaster"> | ||
<param name="use_sim_time" value="true" /> | ||
</node> | ||
<!--Mobile Base Controller--> | ||
<node pkg="controller_manager" exec="spawner" args="forward_position_controller"> | ||
<param name="use_sim_time" value="true" /> | ||
</node> | ||
|
||
<!-- Rviz --> | ||
<node if="$(var gui)" pkg="rviz2" exec="rviz2" output="log" args="-d $(find-pkg-share $(var ros2_control_demo_description))/rrbot/rviz/rrbot.rviz"> | ||
<param name="use_sim_time" value="true" /> | ||
</node> | ||
|
||
</launch> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dear @destogl maybe we do not need the equivalent xml file here, as it is not in the other examples. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?xml version="1.0" ?> | ||
<sdf version="1.6"> | ||
<world name="empty"> | ||
<physics name="1ms" type="ignored"> | ||
<max_step_size>0.001</max_step_size> | ||
<real_time_factor>1.0</real_time_factor> | ||
</physics> | ||
<plugin | ||
filename="gz-sim-physics-system" | ||
name="gz::sim::systems::Physics"> | ||
</plugin> | ||
<plugin | ||
filename="gz-sim-user-commands-system" | ||
name="gz::sim::systems::UserCommands"> | ||
</plugin> | ||
<plugin | ||
filename="gz-sim-scene-broadcaster-system" | ||
name="gz::sim::systems::SceneBroadcaster"> | ||
</plugin> | ||
<plugin | ||
filename="gz-sim-contact-system" | ||
name="gz::sim::systems::Contact"> | ||
</plugin> | ||
<plugin | ||
filename="gz-sim-sensors-system" | ||
name="gz::sim::systems::Sensors"> | ||
<render_engine>ogre2</render_engine> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like this is the only difference with the default gz-sim Do we need it here ? |
||
</plugin> | ||
|
||
<light type="directional" name="sun"> | ||
<cast_shadows>true</cast_shadows> | ||
<pose>0 0 10 0 0 0</pose> | ||
<diffuse>0.8 0.8 0.8 1</diffuse> | ||
<specular>0.2 0.2 0.2 1</specular> | ||
<attenuation> | ||
<range>1000</range> | ||
<constant>0.9</constant> | ||
<linear>0.01</linear> | ||
<quadratic>0.001</quadratic> | ||
</attenuation> | ||
<direction>-0.5 0.1 -0.9</direction> | ||
</light> | ||
|
||
<model name="ground_plane"> | ||
<static>true</static> | ||
<link name="link"> | ||
<collision name="collision"> | ||
<geometry> | ||
<plane> | ||
<normal>0 0 1</normal> | ||
<size>100 100</size> | ||
</plane> | ||
</geometry> | ||
</collision> | ||
<visual name="visual"> | ||
<geometry> | ||
<plane> | ||
<normal>0 0 1</normal> | ||
<size>100 100</size> | ||
</plane> | ||
</geometry> | ||
<material> | ||
<ambient>0.8 0.8 0.8 1</ambient> | ||
<diffuse>0.8 0.8 0.8 1</diffuse> | ||
<specular>0.8 0.8 0.8 1</specular> | ||
</material> | ||
</visual> | ||
</link> | ||
</model> | ||
|
||
</world> | ||
</sdf> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not naming the node
clock_bridge
as in the python equivalent ?