Skip to content

Commit 103a7f2

Browse files
committed
Converted urdf, launch and moveit config to use namespaced plugins to handle ros_control and sr_gazebo plugins
Instantiation of right hand and right arm added as well as macros for plugins to handle namespace ur10 plugin uses again position interface in sim as in real world
1 parent 0887b0d commit 103a7f2

File tree

9 files changed

+144
-60
lines changed

9 files changed

+144
-60
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<robot xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
2+
xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
3+
xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"
4+
xmlns:xacro="http://www.ros.org/wiki/xacro"
5+
name="shadowhand_motor">
6+
<xacro:include filename="$(find sr_description)/materials.urdf.xacro" />
7+
<xacro:include filename="$(find sr_description)/hand/xacro/full_hand.urdf.xacro" />
8+
<xacro:include filename="$(find sr_description)/other/xacro/gazebo/gazebo.urdf.xacro" />
9+
<xacro:shadowhand muscletrans="false" muscle="false" bio="false" bt_sp="false"
10+
ubi="false" eli="false" reflect="1.0" prefix="rh_" />
11+
</robot>

sr_multi_description/urdf/right_srhand_ur10.urdf.xacro

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
<robot xmlns:xacro="http://ros.org/wiki/xacro" name="ur10srh">
1+
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="ur10srh">
22

33
<!--<xacro:include filename="$(find ur_description)/urdf/gazebo.urdf.xacro" />-->
44
<xacro:include filename="$(find ur_description)/urdf/ur10.urdf.xacro" />
5+
56
<link name="world" />
67

78
<joint name="world_joint" type="fixed">
@@ -10,14 +11,21 @@
1011
<origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0" />
1112
</joint>
1213

13-
<xacro:ur10_robot prefix="ra_" joint_limited="false"/>
14-
14+
<!-- instantiate the arm -->
15+
<xacro:ur10_robot prefix="ra_" joint_limited="false" />
16+
<!-- add the plugin which will be in a namespace (ra) -->
17+
<xacro:include filename="$(find sr_multi_description)/urdf/ur_gazebo.urdf.xacro" />
18+
<xacro:ur_gazebo_controller_manager namespace="ra" />
19+
1520
<xacro:include filename="$(find sr_description)/materials.urdf.xacro" />
1621
<xacro:include filename="$(find sr_description)/hand/xacro/full_hand.urdf.xacro" />
17-
<xacro:include filename="$(find sr_description)/other/xacro/gazebo/gazebo.urdf.xacro" />
18-
22+
23+
<!-- instantiate the hand -->
1924
<xacro:shadowhand muscletrans="false" muscle="false" bio="false" bt_sp="false" ubi="false" eli="false" reflect="1.0" prefix="rh_" />
20-
25+
<!-- add the plugin which will be in a namespace (rh) -->
26+
<xacro:include filename="$(find sr_multi_description)/urdf/sr_gazebo.urdf.xacro" />
27+
<xacro:shadow_gazebo_controller_manager namespace="rh" />
28+
2129
<joint name="arm_to_hand" type="fixed">
2230
<parent link="ra_ee_link" />
2331
<child link = "rh_forearm" />

sr_multi_description/urdf/right_srhand_ur10_joint_limited.urdf.xacro

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<robot xmlns:xacro="http://ros.org/wiki/xacro" name="ur10srh">
1+
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="ur10srh">
22

33
<!--<xacro:include filename="$(find ur_description)/urdf/gazebo.urdf.xacro" />-->
44
<xacro:include filename="$(find ur_description)/urdf/ur10.urdf.xacro" />
@@ -11,14 +11,21 @@
1111
<origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0" />
1212
</joint>
1313

14-
<xacro:ur10_robot prefix="ra_" joint_limited="true"/>
15-
14+
<!-- instantiate the arm -->
15+
<xacro:ur10_robot prefix="ra_" joint_limited="true" />
16+
<!-- add the plugin which will be in a namespace (ra) -->
17+
<xacro:include filename="$(find sr_multi_description)/urdf/ur_gazebo.urdf.xacro" />
18+
<xacro:ur_gazebo_controller_manager namespace="ra" />
19+
1620
<xacro:include filename="$(find sr_description)/materials.urdf.xacro" />
1721
<xacro:include filename="$(find sr_description)/hand/xacro/full_hand.urdf.xacro" />
18-
<xacro:include filename="$(find sr_description)/other/xacro/gazebo/gazebo.urdf.xacro" />
19-
22+
23+
<!-- instantiate the hand -->
2024
<xacro:shadowhand muscletrans="false" muscle="false" bio="false" bt_sp="false" ubi="false" eli="false" reflect="1.0" prefix="rh_" />
21-
25+
<!-- add the plugin which will be in a namespace (rh) -->
26+
<xacro:include filename="$(find sr_multi_description)/urdf/sr_gazebo.urdf.xacro" />
27+
<xacro:shadow_gazebo_controller_manager namespace="rh" />
28+
2229
<joint name="arm_to_hand" type="fixed">
2330
<parent link="ra_ee_link" />
2431
<child link = "rh_forearm" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0"?>
2+
<robot xmlns:xacro="http://www.ros.org/wiki/xacro"
3+
name="ur10" >
4+
5+
<!-- ur10 -->
6+
<xacro:include filename="$(find ur_description)/urdf/ur10.urdf.xacro" />
7+
8+
<!-- arm -->
9+
<xacro:ur10_robot prefix="ra_" joint_limited="true"/>
10+
11+
<link name="world" />
12+
13+
<joint name="world_joint" type="fixed">
14+
<parent link="world" />
15+
<child link = "ra_base_link" />
16+
<origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0" />
17+
</joint>
18+
19+
</robot>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0"?>
2+
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
3+
<!-- namespace must be set up according to launch file namespace -->
4+
<xacro:macro name="shadow_gazebo_controller_manager" params="namespace">
5+
<gazebo>
6+
<plugin name="sr_gazebo_ros_controller_manager" filename="libsr_gazebo_ros_controller_manager.so">
7+
<alwaysOn>true</alwaysOn>
8+
<updateRate>1400.0</updateRate>
9+
<robotNamespace>${namespace}</robotNamespace>
10+
</plugin>
11+
</gazebo>
12+
</xacro:macro>
13+
</robot>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0"?>
2+
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
3+
4+
<xacro:macro name="ur_gazebo_controller_manager" params="namespace">
5+
<gazebo>
6+
<plugin filename="libgazebo_ros_control.so" name="ros_control">
7+
<robotNamespace>${namespace}</robotNamespace>
8+
</plugin>
9+
</gazebo>
10+
</xacro:macro>
11+
</robot>

sr_multi_moveit/right_sr_ur10_moveit_config/config/controllers.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
controller_list:
2-
- name: ra_trajectory_controller
2+
- name: ra/ra_trajectory_controller
33
action_ns: follow_joint_trajectory
44
type: FollowJointTrajectory
55
default: true
@@ -10,7 +10,7 @@ controller_list:
1010
- ra_wrist_1_joint
1111
- ra_wrist_2_joint
1212
- ra_wrist_3_joint
13-
- name: rh_trajectory_controller
13+
- name: rh/rh_trajectory_controller
1414
action_ns: follow_joint_trajectory
1515
type: FollowJointTrajectory
1616
default: true
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,19 @@
11
ra_trajectory_controller:
2-
type: effort_controllers/JointTrajectoryController
3-
topic: "ra_trajectory_controller"
2+
type: "position_controllers/JointTrajectoryController"
43
joints:
5-
- ra_shoulder_pan_joint
6-
- ra_shoulder_lift_joint
7-
- ra_elbow_joint
8-
- ra_wrist_1_joint
9-
- ra_wrist_2_joint
10-
- ra_wrist_3_joint
11-
gains:
12-
ra_shoulder_pan_joint: {p: 600.0, i: 500.0, d: 100.0, i_clamp: 100.0}
13-
ra_shoulder_lift_joint: {p: 1500.0, i: 500.0, d: 100.0, i_clamp: 100.0}
14-
ra_elbow_joint: {p: 1500.0, i: 500.0, d: 100.0, i_clamp: 100.0}
15-
ra_wrist_1_joint: {p: 100.0, i: 0.0, d: 0.0, i_clamp: 0.0}
16-
ra_wrist_2_joint: {p: 100.0, i: 0.0, d: 0.0, i_clamp: 0.0}
17-
ra_wrist_3_joint: {p: 100.0, i: 0.0, d: 0.0, i_clamp: 0.0}
4+
- ra_shoulder_pan_joint
5+
- ra_shoulder_lift_joint
6+
- ra_elbow_joint
7+
- ra_wrist_1_joint
8+
- ra_wrist_2_joint
9+
- ra_wrist_3_joint
1810
constraints:
1911
goal_time: 0.6
20-
stopped_velocity_tolerance: 0.5
21-
22-
ra_shoulder_pan_joint: {trajectory: 0.1, goal: 0.1}
23-
ra_shoulder_lift_joint: {trajectory: 0.1, goal: 0.1}
24-
ra_elbow_joint: {trajectory: 0.1, goal: 0.1}
25-
ra_wrist_1_joint: {trajectory: 0.1, goal: 0.1}
26-
ra_wrist_2_joint: {trajectory: 0.1, goal: 0.1}
27-
ra_wrist_3_joint: {trajectory: 0.1, goal: 0.1}
28-
12+
stopped_velocity_tolerance: 0.05
13+
ra_shoulder_pan_joint: {trajectory: 0.3, goal: 0.1}
14+
ra_shoulder_lift_joint: {trajectory: 0.3, goal: 0.1}
15+
ra_elbow_joint: {trajectory: 0.3, goal: 0.1}
16+
ra_wrist_1_joint: {trajectory: 0.3, goal: 0.1}
17+
ra_wrist_2_joint: {trajectory: 0.3, goal: 0.1}
18+
ra_wrist_3_joint: {trajectory: 0.3, goal: 0.1}
2919
stop_trajectory_duration: 0.5
30-
state_publish_rate: 25
31-
action_monitor_rate: 10

sr_robot_launch/launch/right_srhand_ur10arm.launch

+47-20
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,55 @@
3030
<arg name="world_name"
3131
value="$(find sr_description)/other/worlds/shadowhand.world" />
3232
<arg name="paused" value="false" />
33+
<!-- arm + hand + controller plugins -->
3334
<param name="robot_description"
3435
command="$(find xacro)/xacro.py '$(arg robot_description)'" />
36+
<node name="arm_hand_joint_state_merger"
37+
pkg="joint_state_publisher" type="joint_state_publisher">
38+
<param name="use_gui" value="false"/>
39+
<rosparam param="source_list" >["/ra/joint_states","/rh/joint_states"]</rosparam>
40+
</node>
41+
<arg name="pos" value="0.012 0.0 0.0 1.5708 3.1416 1.5708" />
42+
<node pkg="tf" type="static_transform_publisher" name="base_link" args="$(arg pos) /ra_ee_link /rh_forearm 100"/>
43+
44+
<!-- hand urdf alone and its controllers in a namespace -->
45+
<group ns="rh">
46+
<param name="robot_description"
47+
command="$(find xacro)/xacro.py '$(find sr_multi_description)/urdf/right_shadowhand_motor.urdf.xacro'" />
48+
<include file="$(find sr_hand)/launch/gazebo/loaders/hand_controllers.launch">
49+
<arg name="hand_controller_gazebo"
50+
value="$(find sr_description)/hand/config/right_hand_controller_gazebo.yaml" />
51+
</include>
52+
53+
<rosparam command="load"
54+
file="$(find sr_robot_launch)/config/rh_trajectory_controller.yaml" />
55+
<group if="$(arg hand_trajectory)">
56+
<node name="hand_trajectory_controller_spawner"
57+
pkg="controller_manager" type="spawner" output="screen"
58+
args="--shutdown-timeout=1.0 rh_trajectory_controller" />
59+
</group>
60+
61+
<!-- joint_state_controller -->
62+
<include file="$(find ros_ethercat_model)/launch/joint_state_publisher.launch" />
63+
64+
<node pkg="robot_state_publisher" type="state_publisher"
65+
name="robot_state_publisher_target_rh"/>
66+
</group>
67+
68+
<!-- arm urdf alone and its controllers in a namespace -->
69+
<group ns="ra">
70+
<param name="robot_description"
71+
command="$(find xacro)/xacro.py '$(find sr_multi_description)/urdf/right_ur10_robot.urdf.xacro'" />
72+
<include file="$(find ur_gazebo)/launch/controller_utils.launch" />
73+
<rosparam file="$(find sr_robot_launch)/config/gazebo/controller/ra_trajectory_controller.yaml"
74+
command="load" />
75+
<group if="$(arg arm_trajectory)">
76+
<node name="arm_trajectory_controller_spawner"
77+
pkg="controller_manager" type="spawner" output="screen"
78+
args="--shutdown-timeout=1.0 ra_trajectory_controller" />
79+
</group>
80+
</group>
81+
3582
<include file="$(find gazebo_ros)/launch/empty_world.launch">
3683
<arg name="world_name" default="$(arg world_name)" />
3784
<arg name="gui" default="true" />
@@ -41,26 +88,6 @@
4188
<node name="spawn_model" pkg="gazebo_ros" type="spawn_model"
4289
args="-urdf -param robot_description -model ur10srh -z 0.05 -J ra_elbow_joint 0.0 -J ra_shoulder_lift_joint 0.0 -J ra_shoulder_pan_joint 0.0 -J ra_wrist_1_joint 0.0 -J ra_wrist_2_joint 0.0 -J ra_wrist_3_joint 0.0"
4390
respawn="false" output="screen" />
44-
<include file="$(find ur_gazebo)/launch/controller_utils.launch" />
45-
<include file="$(find sr_hand)/launch/gazebo/loaders/hand_controllers.launch">
46-
47-
<arg name="hand_controller_gazebo"
48-
value="$(find sr_description)/hand/config/right_hand_controller_gazebo.yaml" />
49-
</include>
50-
<rosparam file="$(find sr_robot_launch)/config/gazebo/controller/ra_trajectory_controller.yaml"
51-
command="load" />
52-
<group if="$(arg arm_trajectory)">
53-
<node name="arm_trajectory_controller_spawner"
54-
pkg="controller_manager" type="spawner" output="screen"
55-
args="--shutdown-timeout=1.0 ra_trajectory_controller" />
56-
</group>
57-
<rosparam command="load"
58-
file="$(find sr_robot_launch)/config/rh_trajectory_controller.yaml" />
59-
<group if="$(arg hand_trajectory)">
60-
<node name="hand_trajectory_controller_spawner"
61-
pkg="controller_manager" type="spawner" output="screen"
62-
args="--shutdown-timeout=1.0 rh_trajectory_controller" />
63-
</group>
6491
</group>
6592
<!-- REAL ROBOTS -->
6693
<group unless="$(arg sim)">

0 commit comments

Comments
 (0)