Skip to content
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

F#src 4537 test compliance #587

Open
wants to merge 41 commits into
base: melodic-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
6bb82f9
first attempt
dg-shadow Apr 23, 2020
5eb47bb
Least terrible tuning I could find
dg-shadow Apr 28, 2020
0096de9
Comment out gazebo pid gains
toliver May 1, 2020
8ea321e
Merge remote-tracking branch 'origin/melodic-devel' into F#SRC-4537_t…
toliver May 1, 2020
1e6ee3c
Add FT sensor to right hand UR10e xacro
toliver Sep 23, 2020
1c8e3ae
Merge branch 'melodic-devel' into F#SRC-4538_test_compliance_in_sim
toliver Oct 5, 2020
2ddd51f
debugging
Nov 16, 2020
1beca70
debugging
Nov 16, 2020
7188d1b
debugging
Nov 16, 2020
2da2801
parameters
Nov 24, 2020
a7f008f
params
Nov 24, 2020
20571b4
merging
Nov 24, 2020
965884a
remove box
Nov 25, 2020
5e1a2b8
Merge branch 'F#SRC-4537_test_compliance_in_sim' of github.com:shadow…
Nov 25, 2020
554958c
mass and kinematics
Nov 25, 2020
1120b3e
Merge branch 'F#SRC-4537_test_compliance_in_sim' of github.com:shadow…
Nov 25, 2020
29f7116
add transmission interface to launch files for hw
Dec 15, 2020
ec2c54c
fix arg bug
Dec 16, 2020
3722df8
trying to load both controllers
Dec 17, 2020
a7ef978
test flag
Dec 17, 2020
b3f1474
load both
Dec 17, 2020
4bac55a
load both
Dec 17, 2020
5f1ded8
both controllers
Dec 17, 2020
56c7b42
both
Dec 17, 2020
4641955
test
Dec 17, 2020
fa3b9ce
start wrench_to_joint_vel_pub when using compliance controller
Dec 17, 2020
36914b7
bug
Dec 18, 2020
176feb9
condition around compliance
Dec 18, 2020
54b4b79
remove old controller
Dec 18, 2020
4e2f076
test
Dec 18, 2020
0c3007a
resetting xacros
Dec 18, 2020
e58f5d4
merging melodic
Dec 18, 2020
ec273f3
Merge branch 'melodic-devel' into F#SRC-4537_test_compliance_in_sim
carebare47 Dec 18, 2020
6326306
fix
Dec 18, 2020
f0efa25
tidying
Jan 7, 2021
de75231
Merge branch 'melodic-devel' into F#SRC-4537_test_compliance
carebare47 Jan 7, 2021
4c848f8
tidying
Jan 7, 2021
adb6948
Merge branch 'F#SRC-4537_test_compliance' of github.com:shadow-robot/…
Jan 7, 2021
c15e9da
Merge branch 'melodic-devel' into F#SRC-4537_test_compliance
giusebar Jan 15, 2021
8c22b51
Merge branch 'melodic-devel' into F#SRC-4537_test_compliance
carebare47 Feb 2, 2021
c846ca1
Merge branch 'melodic-devel' into F#SRC-4537_test_compliance
carebare47 Mar 30, 2021
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
30 changes: 28 additions & 2 deletions sr_multi_description/urdf/right_srhand_ur10e.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,35 @@
<xacro:shadowhand muscletrans="false" muscle="false" bio="false" bt_sp="false" ubi="false" eli="false"
reflect="1.0" prefix="rh_" lf="true" cable_mesh="true"/>

<!-- We use wrist_3_link instead of ee_link due to a bug in preserveFixedJoint
where it currently won't work with links that don't have an inertial component
as is the case with ee_link. These links get removed when converting to SDF.
See more on this subject in this issue https://github.com/osrf/sdformat/issues/199 -->
<joint name="ra_arm_to_hand" type="fixed">
<parent link="ra_ee_link"/>
<parent link="ra_wrist_3_link"/>
<child link="rh_forearm"/>
<origin xyz="0.012 0.0 0.0" rpy="${pi/2.0} ${0.0} ${pi/2.0}"/>
<origin xyz="0.0 0.0 0.012" rpy="${0.0} ${0.0} ${pi}"/>
</joint>

<gazebo reference="ra_arm_to_hand">
<preserveFixedJoint>true</preserveFixedJoint>
<sensor name="ra_force_torque" type="force_torque">
<always_on>true</always_on>
<visualize>true</visualize>
<force_torque>
<frame>sensor</frame>
<measure_direction>child_to_parent</measure_direction>
</force_torque>
</sensor>

<provideFeedback>true</provideFeedback>
</gazebo>

<gazebo>
<plugin name="ft_sensor" filename="libgazebo_ros_ft_sensor.so">
<updateRate>125.0</updateRate>
<topicName>ra_wrench</topicName>
<jointName>ra_arm_to_hand</jointName>
</plugin>
</gazebo>
</robot>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ robot:
arm:
name: ur10
main_group: manipulator
moveit_path:
moveit_path:
package: sr_multi_moveit_config
relative_path: /config/ur
extra_groups_config_path: /config
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# gazebo_ros_control:
# pid_gains:
# ra_shoulder_pan_joint: {p: 500, i: 1000, d: 0.1, i_clamp_max: 1000, i_clamp_min: -1000, antiwindup: true}
# ra_shoulder_lift_joint: {p: 500, i: 1000, d: 0.1, i_clamp_max: 1000, i_clamp_min: -1000, antiwindup: true}
# ra_elbow_joint: {p: 500, i: 1000, d: 0.1, i_clamp_max: 1000, i_clamp_min: -1000, antiwindup: true}
# ra_wrist_1_joint: {p: 500, i: 1000, d: 0.1, i_clamp_max: 1000, i_clamp_min: -1000, antiwindup: true}
# ra_wrist_2_joint: {p: 500, i: 1000, d: 0.1, i_clamp_max: 1000, i_clamp_min: -1000, antiwindup: true}
# ra_wrist_3_joint: {p: 500, i: 1000, d: 0.1, i_clamp_max: 1000, i_clamp_min: -1000, antiwindup: true}


ra_trajectory_controller:
type: "velocity_controllers/ComplianceController"
joints:
- ra_shoulder_pan_joint
- ra_shoulder_lift_joint
- ra_elbow_joint
- ra_wrist_1_joint
- ra_wrist_2_joint
- ra_wrist_3_joint
compliance_command_timeout: 1.5
constraints:
goal_time: 0.6
stopped_velocity_tolerance: 1.0
ra_shoulder_pan_joint: {trajectory: 0.3, goal: 0.1}
ra_shoulder_lift_joint: {trajectory: 0.3, goal: 0.1}
ra_elbow_joint: {trajectory: 0.3, goal: 0.1}
ra_wrist_1_joint: {trajectory: 0.3, goal: 0.1}
ra_wrist_2_joint: {trajectory: 0.3, goal: 0.1}
ra_wrist_3_joint: {trajectory: 0.3, goal: 0.1}
stop_trajectory_duration: 0.5
state_publish_rate: 25
action_monitor_rate: 10
allow_partial_joints_goal: true
#!!These values have not been optimized!!
gains:
ra_shoulder_pan_joint: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1}
ra_shoulder_lift_joint: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1}
ra_elbow_joint: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1}
ra_wrist_1_joint: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1}
ra_wrist_2_joint: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1}
ra_wrist_3_joint: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1}

# Use a feedforward term to reduce the size of PID gains
velocity_ff:
ra_shoulder_pan_joint: 1.0
ra_shoulder_lift_joint: 1.0
ra_elbow_joint: 1.0
ra_wrist_1_joint: 1.0
ra_wrist_2_joint: 1.0
ra_wrist_3_joint: 1.0
49 changes: 49 additions & 0 deletions sr_robot_launch/config/ra_compliant_trajectory_controller.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

joints: &robot_joints
- ra_shoulder_pan_joint
- ra_shoulder_lift_joint
- ra_elbow_joint
- ra_wrist_1_joint
- ra_wrist_2_joint
- ra_wrist_3_joint

ra_trajectory_controller:
type: "velocity_controllers/ComplianceController"
joints: *robot_joints
compliance_command_timeout: 1.5
constraints:
goal_time: 6.0
stopped_velocity_tolerance: 0.05
ra_shoulder_pan_joint: {trajectory: 0.3, goal: 0.1}
ra_shoulder_lift_joint: {trajectory: 0.3, goal: 0.1}
ra_elbow_joint: {trajectory: 0.3, goal: 0.1}
ra_wrist_1_joint: {trajectory: 0.3, goal: 0.1}
ra_wrist_2_joint: {trajectory: 0.3, goal: 0.1}
ra_wrist_3_joint: {trajectory: 0.3, goal: 0.1}
stop_trajectory_duration: 0.5
state_publish_rate: 250
action_monitor_rate: 10
allow_partial_joints_goal: true
#!!These values have not been optimized!!
gains:
p: &p_gain 20.0
i: &i_gain 0.0
d: &d_gain 0.0
clamp: &i_clamp 1.0
ra_shoulder_pan_joint: {p: *p_gain, i: *i_gain, d: *d_gain, i_clamp: *i_clamp}
ra_shoulder_lift_joint: {p: *p_gain, i: *i_gain, d: *d_gain, i_clamp: *i_clamp}
ra_elbow_joint: {p: *p_gain, i: *i_gain, d: *d_gain, i_clamp: *i_clamp}
ra_wrist_1_joint: {p: *p_gain, i: *i_gain, d: *d_gain, i_clamp: *i_clamp}
ra_wrist_2_joint: {p: *p_gain, i: *i_gain, d: *d_gain, i_clamp: *i_clamp}
ra_wrist_3_joint: {p: *p_gain, i: *i_gain, d: *d_gain, i_clamp: *i_clamp}

# Use a feedforward term to reduce the size of PID gains
velocity_ff:
var: &v_ff 0.0
ra_shoulder_pan_joint: *v_ff
ra_shoulder_lift_joint: *v_ff
ra_elbow_joint: *v_ff
ra_wrist_1_joint: *v_ff
ra_wrist_2_joint: *v_ff
ra_wrist_3_joint: *v_ff

17 changes: 10 additions & 7 deletions sr_robot_launch/config/ra_trajectory_controller.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@

joints: &robot_joints
- ra_shoulder_pan_joint
- ra_shoulder_lift_joint
- ra_elbow_joint
- ra_wrist_1_joint
- ra_wrist_2_joint
- ra_wrist_3_joint

ra_trajectory_controller:
type: "position_controllers/JointTrajectoryController"
hardware_interface:
joints: &robot_joints
- ra_shoulder_pan_joint
- ra_shoulder_lift_joint
- ra_elbow_joint
- ra_wrist_1_joint
- ra_wrist_2_joint
- ra_wrist_3_joint
joints: *robot_joints
joints: *robot_joints
constraints:
goal_time: 0.6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
<arg name="arm_robot_hw_1" if="$(eval arg('robot_model') == 'ur10e')" default="$(find sr_robot_launch)/config/right_ur10e_arm_robot_hw.yaml"/>
<arg name="arm_robot_hw_2" if="$(eval not arg('robot_model') == 'ur10e')" default="$(find sr_robot_launch)/config/left_bimanual_ur_arm_robot_hw.yaml"/>
<arg name="arm_robot_hw_2" if="$(eval arg('robot_model') == 'ur10e')" default="$(find sr_robot_launch)/config/left_bimanual_ur10e_arm_robot_hw.yaml"/>
<arg name="arm_compliance_control" default="false"/>
<arg if="$(arg arm_compliance_control)" name="arm_transmission_interface" default="hardware_interface/VelocityJointInterface"/>
<arg unless="$(arg arm_compliance_control)" name="arm_transmission_interface" default="hardware_interface/PositionJointInterface"/>
<arg name="urcap_program_name" default="external_ctrl.urp"/>

<arg name="arm_trajectory" default="true"/>
Expand All @@ -56,8 +59,8 @@
<arg unless="$(eval hands == 'none')" name="arm_payload_cog" default="[0.0, 0.0, 0.12]"/>
<arg if="$(eval hands == 'none')" name="arm_payload_mass" default="0.0"/>
<arg if="$(eval hands == 'none')" name="arm_payload_cog" default="[0.0, 0.0, 0.0]"/>
<arg name="load_robot_description_command" default="xacro $(arg robot_description) arm_1_z:=$(arg arm_1_z) arm_2_z:=$(arg arm_2_z) arm_x_separation:=$(arg arm_x_separation) arm_y_separation:=$(arg arm_y_separation) transmission_hw_interface:=$(arg arm_transmission_interface)"/>

<arg name="load_robot_description_command" default="xacro $(arg robot_description) arm_1_z:=$(arg arm_1_z) arm_2_z:=$(arg arm_2_z) arm_x_separation:=$(arg arm_x_separation) arm_y_separation:=$(arg arm_y_separation)"/>

<node pkg="rosservice" type="rosservice" name="set_right_speed_scale" args="call --wait /ra_sr_ur_robot_hw/set_speed_slider 'speed_slider_fraction: $(arg right_arm_speed_scale)'"/>
<node pkg="rosservice" type="rosservice" name="set_left_speed_scale" args="call --wait /la_sr_ur_robot_hw/set_speed_slider 'speed_slider_fraction: $(arg left_arm_speed_scale)'"/>
Expand Down
22 changes: 16 additions & 6 deletions sr_robot_launch/launch/sr_hardware_control_loop.launch
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
<arg name="hand_trajectory" default="true"/>

<!-- ARMS CONFIG-->
<arg name="arm_compliance_control" default="true"/>
<arg name="initial_z" if="$(arg arm)" default="0.7551"/>
<arg name="initial_z" unless="$(arg arm)" default="0.0"/>
<arg name="arm_x_separation" default="0.0"/>
Expand All @@ -61,10 +62,14 @@
<arg if="$(arg hand)" name="arm_payload_cog" default="[0.0, 0.0, 0.12]"/>
<arg unless="$(arg hand)" name="arm_payload_mass" default="0.0"/>
<arg unless="$(arg hand)" name="arm_payload_cog" default="[0.0, 0.0, 0.0]"/>
<arg if="$(arg arm_compliance_control)" name="arm_transmission_interface" default="hardware_interface/VelocityJointInterface"/>
<arg unless="$(arg arm_compliance_control)" name="arm_transmission_interface" default="hardware_interface/PositionJointInterface"/>
<arg name="kinematics_config" if="$(eval robot_model[-1] == 'e')" default="$(find ur_e_description)/config/$(arg robot_model)_default.yaml"/>
<arg name="kinematics_config" if="$(eval not robot_model[-1] == 'e')" default="$(find ur_description)/config/$(arg robot_model)_default.yaml"/>
<arg name="urcap_program_name" default="external_ctrl.urp"/>
<arg name="load_robot_description_command" default="xacro $(arg robot_description) prefix:=$(arg hand_id)_ initial_z:=$(arg initial_z) arm_x_separation:=$(arg arm_x_separation) arm_y_separation:=$(arg arm_y_separation) kinematics_config:=$(arg kinematics_config)"/>
<arg if="$(arg arm_compliance_control)" name="trajectory_controller_config" default="$(arg arm_prefix)_compliant_trajectory_controller.yaml"/>
<arg unless="$(arg arm_compliance_control)" name="trajectory_controller_config" default="$(arg arm_prefix)_trajectory_controller.yaml"/>
<arg name="load_robot_description_command" default="xacro $(arg robot_description) prefix:=$(arg hand_id)_ initial_z:=$(arg initial_z) arm_x_separation:=$(arg arm_x_separation) arm_y_separation:=$(arg arm_y_separation) kinematics_config:=$(arg kinematics_config) transmission_hw_interface:=$(arg arm_transmission_interface)"/>

<node pkg="rosservice" type="rosservice" name="set_speed_scale" args="call --wait /$(arg arm_prefix)_sr_ur_robot_hw/set_speed_slider 'speed_slider_fraction: $(arg arm_speed_scale)'"/>
<node pkg="rosservice" type="rosservice" name="set_payload" args="call --wait /$(arg arm_prefix)_sr_ur_robot_hw/set_payload '{payload: $(arg arm_payload_mass), center_of_gravity: $(arg arm_payload_cog)}'"/>
Expand Down Expand Up @@ -156,23 +161,28 @@
- unique_robot_hw
</rosparam>

<node if="$(arg arm_compliance_control)" name="conditional_delayed_rostool_wrench_to_joint_vel_pub" pkg="sr_utilities_common" type="conditional_delayed_rostool.py" output="screen">
<param name="package_name" value="wrench_to_joint_vel_pub" />
<param name="executable_name" value="ur_compliance.launch" />
<rosparam param="params_list">[/robot_description, /robot_description_semantic]</rosparam>
<param name="timeout" value="30.0" />
</node>

<!-- These will be loaded if hand is false so UR10 with box will load instead. -->
<group unless="$(arg hand)">
<include file="$(find ros_ethercat_model)/launch/joint_state_publisher.launch">
<arg name="publish_rate" value="$(arg joint_state_pub_frequency)"/>
</include>
<node if="$(arg debug)" name="ur_arm_robot" pkg="ros_control_robot" type="ros_control_robot" args="" output="screen" launch-prefix="gdb -ex run -args"/>
<node unless="$(arg debug)" name="ur_arm_robot" pkg="ros_control_robot" type="ros_control_robot" args="" output="screen" launch-prefix="ethercat_grant"/>

</group>
<!-- These will be loaded if arm and hand are enabled -->
<!-- Trajectory mode -->
<group if="$(arg arm_ctrl)">
<group if="$(arg arm_trajectory)">
<group if="$(arg hand_ctrl)">
<rosparam command="load" file="$(find sr_robot_launch)/config/$(arg arm_prefix)_trajectory_controller.yaml"/>
</group>
<rosparam unless="$(arg hand_ctrl)" command="load" file="$(find sr_robot_launch)/config/$(arg arm_prefix)_trajectory_controller.yaml"/>
<node name="arm_trajectory_controller_spawner" pkg="controller_manager" type="spawner" output="screen"
<rosparam command="load" file="$(find sr_robot_launch)/config/$(arg trajectory_controller_config)"/>
<node unless="$(arg hand_ctrl)" name="arm_trajectory_controller_spawner" pkg="controller_manager" type="spawner" output="screen"
args="--wait-for=/$(arg arm_prefix)_sr_ur_robot_hw/robot_program_running $(arg arm_prefix)_trajectory_controller"/>
</group>
<!-- Position mode -->
Expand Down