-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
269 additions
and
419 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
81 changes: 81 additions & 0 deletions
81
ros2_control_demo_bringup/launch/rrbot_system_multi_interface.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,81 @@ | ||
# Copyright 2021 Department of Engineering Cybernetics, NTNU. | ||
# | ||
# 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. | ||
|
||
from launch import LaunchDescription | ||
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription | ||
from launch.launch_description_sources import PythonLaunchDescriptionSource | ||
from launch.substitutions import LaunchConfiguration, ThisLaunchFileDir | ||
|
||
|
||
def generate_launch_description(): | ||
# Declare arguments | ||
declared_arguments = [] | ||
declared_arguments.append( | ||
DeclareLaunchArgument( | ||
"prefix", | ||
default_value='""', | ||
description="Prefix of the joint names, useful for \ | ||
multi-robot setup. If changed than also joint names in the controllers' configuration \ | ||
have to be updated.", | ||
) | ||
) | ||
declared_arguments.append( | ||
DeclareLaunchArgument( | ||
"use_fake_hardware", | ||
default_value="true", | ||
description="Start robot with fake hardware mirroring command to its states.", | ||
) | ||
) | ||
declared_arguments.append( | ||
DeclareLaunchArgument( | ||
"fake_sensor_commands", | ||
default_value="false", | ||
description="Enable fake command interfaces for sensors used for simple simulations. \ | ||
Used only if 'use_fake_hardware' parameter is true.", | ||
) | ||
) | ||
declared_arguments.append( | ||
DeclareLaunchArgument( | ||
"slowdown", default_value="3.0", description="Slowdown factor of the RRbot." | ||
) | ||
) | ||
declared_arguments.append( | ||
DeclareLaunchArgument( | ||
"robot_controller", | ||
default_value="forward_position_controller", | ||
description="Robot controller to start.", | ||
) | ||
) | ||
|
||
# Initialize Arguments | ||
prefix = LaunchConfiguration("prefix") | ||
use_fake_hardware = LaunchConfiguration("use_fake_hardware") | ||
fake_sensor_commands = LaunchConfiguration("fake_sensor_commands") | ||
slowdown = LaunchConfiguration("slowdown") | ||
robot_controller = LaunchConfiguration("robot_controller") | ||
|
||
base_launch = IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource([ThisLaunchFileDir(), "/rrbot.launch.py"]), | ||
launch_arguments={ | ||
"controllers_file": "rrbot_multi_interface_forward_controllers.yaml", | ||
"description_file": "rrbot_system_multi_interface.urdf.xacro", | ||
"prefix": prefix, | ||
"use_fake_hardware": use_fake_hardware, | ||
"fake_sensor_commands": fake_sensor_commands, | ||
"slowdown": slowdown, | ||
"robot_controller": robot_controller, | ||
}.items(), | ||
) | ||
|
||
return LaunchDescription(declared_arguments + [base_launch]) |
105 changes: 105 additions & 0 deletions
105
ros2_control_demo_bringup/launch/rrbot_system_position_only_gazebo.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,105 @@ | ||
# Copyright 2021 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. | ||
|
||
from launch import LaunchDescription | ||
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription | ||
from launch.launch_description_sources import PythonLaunchDescriptionSource | ||
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution, ThisLaunchFileDir | ||
|
||
from launch_ros.actions import Node | ||
from launch_ros.substitutions import FindPackageShare | ||
|
||
|
||
def generate_launch_description(): | ||
# Declare arguments | ||
declared_arguments = [] | ||
declared_arguments.append( | ||
DeclareLaunchArgument( | ||
"prefix", | ||
default_value='""', | ||
description="Prefix of the joint names, useful for \ | ||
multi-robot setup. If changed than also joint names in the controllers' configuration \ | ||
have to be updated.", | ||
) | ||
) | ||
declared_arguments.append( | ||
DeclareLaunchArgument( | ||
"use_fake_hardware", | ||
default_value="true", | ||
description="Start robot with fake hardware mirroring command to its states.", | ||
) | ||
) | ||
declared_arguments.append( | ||
DeclareLaunchArgument( | ||
"fake_sensor_commands", | ||
default_value="false", | ||
description="Enable fake command interfaces for sensors used for simple simulations. \ | ||
Used only if 'use_fake_hardware' parameter is true.", | ||
) | ||
) | ||
declared_arguments.append( | ||
DeclareLaunchArgument( | ||
"slowdown", default_value="3.0", description="Slowdown factor of the RRbot." | ||
) | ||
) | ||
declared_arguments.append( | ||
DeclareLaunchArgument( | ||
"robot_controller", | ||
default_value="forward_position_controller", | ||
description="Robot controller to start.", | ||
) | ||
) | ||
|
||
# Initialize Arguments | ||
prefix = LaunchConfiguration("prefix") | ||
use_fake_hardware = LaunchConfiguration("use_fake_hardware") | ||
fake_sensor_commands = LaunchConfiguration("fake_sensor_commands") | ||
slowdown = LaunchConfiguration("slowdown") | ||
robot_controller = LaunchConfiguration("robot_controller") | ||
|
||
gazebo = IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource( | ||
[ | ||
PathJoinSubstitution( | ||
[ | ||
FindPackageShare("gazebo_ros"), | ||
"launch", | ||
"/gazebo.launch.py", | ||
] | ||
) | ||
] | ||
), | ||
launch_arguments={"verbose": "false"}.items(), | ||
) | ||
|
||
spawn_entity = Node( | ||
package="gazebo_ros", | ||
executable="spawn_entity.py", | ||
arguments=["-topic", "robot_description", "-entity", "rrbot_system_position"], | ||
output="screen", | ||
) | ||
|
||
base_launch = IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource([ThisLaunchFileDir(), "/rrbot.launch.py"]), | ||
launch_arguments={ | ||
"description_file": "rrbot_system_position_only.urdf.xacro", | ||
"prefix": prefix, | ||
"use_fake_hardware": use_fake_hardware, | ||
"fake_sensor_commands": fake_sensor_commands, | ||
"slowdown": slowdown, | ||
"robot_controller": robot_controller, | ||
}.items(), | ||
) | ||
|
||
return LaunchDescription(declared_arguments + [gazebo, base_launch, spawn_entity]) |
File renamed without changes.
File renamed without changes.
30 changes: 23 additions & 7 deletions
30
...system_multi_interface.ros2_control.xacro → ...system_multi_interface.ros2_control.xacro
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
46 changes: 46 additions & 0 deletions
46
ros2_control_demo_description/urdf/rrbot_system_multi_interface.urdf.xacro
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 @@ | ||
<?xml version="1.0"?> | ||
<!-- Revolute-Revolute Manipulator --> | ||
<!-- | ||
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="use_fake_hardware" default="true" /> | ||
<xacro:arg name="fake_sensor_commands" default="false" /> | ||
<xacro:arg name="prefix" default="" /> | ||
<xacro:arg name="slowdown" default="2.0" /> | ||
|
||
<!-- Import RRBot macro --> | ||
<xacro:include filename="$(find ros2_control_demo_description)/urdf/rrbot/rrbot.urdf.xacro" /> | ||
|
||
<!-- Import all Gazebo-customization elements, including Gazebo colors --> | ||
<xacro:include filename="$(find ros2_control_demo_description)/urdf/rrbot/gazebo/rrbot.gazebo.xacro" /> | ||
|
||
<!-- Import Rviz colors --> | ||
<xacro:include filename="$(find ros2_control_demo_description)/urdf/rrbot/gazebo/rrbot.materials.xacro" /> | ||
|
||
<!-- Import RRBot ros2_control description --> | ||
<xacro:include filename="$(find ros2_control_demo_description)/urdf/rrbot/ros2_control/rrbot_system_position_only.ros2_control.xacro" /> | ||
|
||
<!-- Used for fixing robot --> | ||
<link name="world"/> | ||
<gazebo reference="world"> | ||
<static>true</static> | ||
</gazebo> | ||
|
||
<xacro:rrbot parent="world" prefix="$(arg prefix)"> | ||
<origin xyz="0 0 0" rpy="0 0 0" /> | ||
</xacro:rrbot> | ||
|
||
<xacro:rrbot_gazebo prefix="$(arg prefix)" /> | ||
|
||
<xacro:rrbot_system_multi_interface | ||
name="RRBotSystemMultiInterface" prefix="$(arg prefix)" | ||
use_fake_hardware="$(arg use_fake_hardware)" | ||
fake_sensor_commands="$(arg fake_sensor_commands)" | ||
slowdown="$(arg slowdown)" /> | ||
|
||
</robot> |
40 changes: 0 additions & 40 deletions
40
...l_demo_robot/description/rrbot/ros2_control/rrbot_system_position_only.ros2_control.xacro
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.