Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
2 changes: 2 additions & 0 deletions ros2_control_demo_robot/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
endif()

ament_environment_hooks("${CMAKE_CURRENT_SOURCE_DIR}/env-hooks/${PROJECT_NAME}.dsv.in")

## EXPORTS
ament_package()
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
controller_manager:
ros__parameters:
update_rate: 100 # Hz

joint_trajectory_controller:
type: joint_trajectory_controller/JointTrajectoryController

joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster

joint_trajectory_controller:
ros__parameters:
joints:
- joint1
- joint2
interface_name: position
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ https://github.com/ros-simulation/gazebo_ros_demos/blob/kinetic-devel/rrbot_desc

<!-- ros_control plugin -->
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<robotNamespace>/rrbot</robotNamespace>
<robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
<plugin name="gazebo_ros2_control" filename="libgazebo_ros2_control.so">
<parameters>$(find ros2_control_demo_robot)/config/rrbot_gazebo_forward_controller_position.yaml</parameters>
</plugin>
</gazebo>

Expand Down Expand Up @@ -71,7 +70,7 @@ https://github.com/ros-simulation/gazebo_ros_demos/blob/kinetic-devel/rrbot_desc
<stddev>0.01</stddev>
</noise>
</ray>
<plugin name="gazebo_ros_head_hokuyo_controller" filename="libgazebo_ros_gpu_laser.so">
<plugin name="gazebo_ros_head_hokuyo_controller" filename="libgazebo_ros_ray_sensor.so">
<topicName>/rrbot/laser/scan</topicName>
<frameName>hokuyo_link</frameName>
</plugin>
Expand Down
253 changes: 253 additions & 0 deletions ros2_control_demo_robot/description/rrbot/meshes/hokuyo.dae

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">

<xacro:macro name="rrbot_system_position_only" params="name prefix slowdown:=2.0">
<xacro:macro name="rrbot_system_position_only" params="name prefix use_sim:='false' slowdown:=2.0">

<ros2_control name="${name}" type="system">
<hardware>
<plugin>ros2_control_demo_hardware/RRBotSystemPositionOnlyHardware</plugin>
<param name="example_param_hw_start_duration_sec">2.0</param>
<param name="example_param_hw_stop_duration_sec">3.0</param>
<param name="example_param_hw_slowdown">${slowdown}</param>
</hardware>

<xacro:if value="$(arg use_sim)">
<hardware>
<plugin>gazebo_ros2_control/GazeboSystem</plugin>
</hardware>
</xacro:if>
<xacro:unless value="$(arg use_sim)">
<hardware>
<plugin>ros2_control_demo_hardware/RRBotSystemPositionOnlyHardware</plugin>
<param name="example_param_hw_start_duration_sec">2.0</param>
<param name="example_param_hw_stop_duration_sec">3.0</param>
<param name="example_param_hw_slowdown">${slowdown}</param>
</hardware>
</xacro:unless>

<joint name="joint1">
<command_interface name="position">
<param name="min">-1</param>
Expand Down
204 changes: 0 additions & 204 deletions ros2_control_demo_robot/description/rrbot/rrbot.urdf.xacro

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,22 @@ Copied and modified from ROS1 example:
https://github.com/ros-simulation/gazebo_ros_demos/blob/kinetic-devel/rrbot_description/urdf/rrbot.xacro
-->
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="2dof_robot">
<xacro:arg name="use_sim" default="false" />

<!-- Enable setting arguments from the launch file -->
<xacro:arg name="slowdown" default="2.0" />

<!-- Import RRBot macro -->
<xacro:include filename="$(find ros2_control_demo_robot)/description/rrbot/rrbot.urdf.xacro" />
<xacro:include filename="$(find ros2_control_demo_robot)/description/rrbot/urdf/rrbot.urdf.xacro" />

<!-- Import all Gazebo-customization elements, including Gazebo colors -->
<xacro:include filename="$(find ros2_control_demo_robot)/description/rrbot/rrbot.gazebo.xacro" />
<xacro:include filename="$(find ros2_control_demo_robot)/description/rrbot/gazebo/rrbot.gazebo.xacro" />

<!-- Import Rviz colors -->
<xacro:include filename="$(find ros2_control_demo_robot)/description/rrbot/rrbot.materials.xacro" />
<xacro:include filename="$(find ros2_control_demo_robot)/description/rrbot/gazebo/rrbot.materials.xacro" />

<!-- Import RRBot ros2_control description -->
<xacro:include filename="$(find ros2_control_demo_robot)/description/rrbot/rrbot_system_position_only.ros2_control.xacro" />
<xacro:include filename="$(find ros2_control_demo_robot)/description/rrbot/ros2_control/rrbot_system_position_only.ros2_control.xacro" />

<!-- Used for fixing robot -->
<link name="world"/>
Expand All @@ -33,6 +34,5 @@ https://github.com/ros-simulation/gazebo_ros_demos/blob/kinetic-devel/rrbot_desc

<xacro:rrbot_gazebo prefix="" />

<xacro:rrbot_system_position_only name="RRBotSystemPositionOnly" prefix="" slowdown="$(arg slowdown)" />

<xacro:rrbot_system_position_only name="RRBotSystemPositionOnly" prefix="" use_sim="$(arg use_sim)" slowdown="$(arg slowdown)" />
</robot>
Loading