Controlling the UR10e via the effort command in the Gazebo environment
Hello. I'm trying to control a UR10e with the effort command in my Gazebo simulation. The effort value I am currently giving each joint is [0.0, -71.0770284, -23.0658876, 0.0, 0.0, 0.0]. This seems to be enough force to move the UR10e. However, on the Gazebo, the UR10e does not move at all, despite receiving the effort command correctly. Passing a very large effort value will cause the joint to move, but that doesn't seem right. Did I something wrong?
UR10e urdf is from the uredescription package, and transmission and gazeboroscontrol plugins have been added as follows.
<?xml version="1.0" encoding="utf-8"?>
<robot
name="ur10e">
<link name="world"/>
<joint name="world_to_ur10e" type="fixed">
<origin xyz="0 0 0" rpy="0 0 0"/>
<parent link="world"/>
<child link="base_link"/>
</joint>
<link name="base_link">
<visual>
<geometry>
<mesh filename="package://ur10e_description/meshes/ur10e/visual/base.dae"/>
</geometry>
<material name="LightGrey">
<color rgba="0.7 0.7 0.7 1.0"/>
</material>
</visual>
<collision>
<geometry>
<mesh filename="package://ur10e_description/meshes/ur10e/collision/base.stl"/>
</geometry>
</collision>
<inertial>
<mass value="4.0"/>
<origin rpy="0 0 0" xyz="0.0 0.0 0.0"/>
<inertia ixx="0.0061063308908" ixy="0.0" ixz="0.0" iyy="0.0061063308908" iyz="0.0" izz="0.01125"/>
</inertial>
</link>
<joint name="shoulder_pan_joint" type="revolute">
<parent link="base_link"/>
<child link="shoulder_link"/>
<origin rpy="0.0 0.0 0.0" xyz="0.0 0.0 0.181"/>
<axis xyz="0 0 1"/>
<limit effort="330.0" lower="-6.283185307179586" upper="6.283185307179586" velocity="3.14"/>
<dynamics damping="0.0" friction="0.0"/>
</joint>
<link name="shoulder_link">
<visual>
<geometry>
<mesh filename="package://ur10e_description/meshes/ur10e/visual/shoulder.dae"/>
</geometry>
<material name="LightGrey">
<color rgba="0.7 0.7 0.7 1.0"/>
</material>
</visual>
<collision>
<geometry>
<mesh filename="package://ur10e_description/meshes/ur10e/collision/shoulder.stl"/>
</geometry>
</collision>
<inertial>
<mass value="7.778"/>
<origin rpy="0 0 0" xyz="0.0 0.0 0.0"/>
<inertia ixx="0.03147431257693659" ixy="0.0" ixz="0.0" iyy="0.03147431257693659" iyz="0.0" izz="0.021875624999999996"/>
</inertial>
</link>
<joint name="shoulder_lift_joint" type="revolute">
<parent link="shoulder_link"/>
<child link="upper_arm_link"/>
<origin rpy="0.0 1.5707963267948966 0.0" xyz="0.0 0.176 0.0"/>
<axis xyz="0 1 0"/>
<limit effort="330.0" lower="-6.283185307179586" upper="6.283185307179586" velocity="3.14"/>
<dynamics damping="0.0" friction="0.0"/>
</joint>
<link name="upper_arm_link">
<visual>
<geometry>
<mesh filename="package://ur10e_description/meshes/ur10e/visual/upperarm.dae"/>
</geometry>
<material name="LightGrey">
<color rgba="0.7 0.7 0.7 1.0"/>
</material>
</visual>
<collision>
<geometry>
<mesh filename="package://ur10e_description/meshes/ur10e/collision/upperarm.stl"/>
</geometry>
</collision>
<inertial>
<mass value="12.93"/>
<origin rpy="0 0 0" xyz="0.0 0.0 0.3065"/>
<inertia ixx="0.4230737407704359" ixy="0.0" ixz="0.0" iyy="0.4230737407704359" iyz="0.0" izz="0.03636562499999999"/>
</inertial>
</link>
<joint name="elbow_joint" type="revolute">
<parent link="upper_arm_link"/>
<child link="forearm_link"/>
<origin rpy="0.0 0.0 0.0" xyz="0.0 -0.137 0.613"/>
<axis xyz="0 1 0"/>
<limit effort="150.0" lower="-3.141592653589793" upper="3.141592653589793" velocity="3.14"/>
<dynamics damping="0.0" friction="0.0"/>
</joint>
<link name="forearm_link">
<visual>
<geometry>
<mesh filename="package://ur10e_description/meshes/ur10e/visual/forearm.dae"/>
</geometry>
<material name="LightGrey">
<color rgba="0.7 0.7 0.7 1.0"/>
</material>
</visual>
<collision>
<geometry>
<mesh filename="package://ur10e_description/meshes/ur10e/collision/forearm.stl"/>
</geometry>
</collision>
<inertial>
<mass value="3.87"/>
<origin rpy="0 0 0" xyz="0.0 0.0 0.2855"/>
<inertia ixx="0.11059036576383598" ixy="0.0" ixz="0.0" iyy="0.11059036576383598" iyz="0.0" izz="0.010884375"/>
</inertial>
</link>
<joint name="wrist_1_joint" type="revolute">
<parent link="forearm_link"/>
<child link="wrist_1_link"/>
<origin rpy="0.0 1.5707963267948966 0.0" xyz="0.0 0.0 0.571"/>
<axis xyz="0 1 0"/>
<limit effort="54.0" lower="-6.283185307179586" upper="6.283185307179586" velocity="6.28"/>
<dynamics damping="0.0" friction="0.0"/>
</joint>
<link name="wrist_1_link">
<visual>
<geometry>
<mesh filename="package://ur10e_description/meshes/ur10e/visual/wrist1.dae"/>
</geometry>
<material name="LightGrey">
<color rgba="0.7 0.7 0.7 1.0"/>
</material>
</visual>
<collision>
<geometry>
<mesh filename="package://ur10e_description/meshes/ur10e/collision/wrist1.stl"/>
</geometry>
</collision>
<inertial>
<mass value="1.96"/>
<origin rpy="0 0 0" xyz="0.0 0.135 0.0"/>
<inertia ixx="0.005108247956699999" ixy="0.0" ixz="0.0" iyy="0.005108247956699999" iyz="0.0" izz="0.005512499999999999"/>
</inertial>
</link>
<joint name="wrist_2_joint" type="revolute">
<parent link="wrist_1_link"/>
<child link="wrist_2_link"/>
<origin rpy="0.0 0.0 0.0" xyz="0.0 0.135 0.0"/>
<axis xyz="0 0 1"/>
<limit effort="54.0" lower="-6.283185307179586" upper="6.283185307179586" velocity="6.28"/>
<dynamics damping="0.0" friction="0.0"/>
</joint>
<link name="wrist_2_link">
<visual>
<geometry>
<mesh filename="package://ur10e_description/meshes/ur10e/visual/wrist2.dae"/>
</geometry>
<material name="LightGrey">
<color rgba="0.7 0.7 0.7 1.0"/>
</material>
</visual>
<collision>
<geometry>
<mesh filename="package://ur10e_description/meshes/ur10e/collision/wrist2.stl"/>
</geometry>
</collision>
<inertial>
<mass value="1.96"/>
<origin rpy="0 0 0" xyz="0.0 0.0 0.12"/>
<inertia ixx="0.005108247956699999" ixy="0.0" ixz="0.0" iyy="0.005108247956699999" iyz="0.0" izz="0.005512499999999999"/>
</inertial>
</link>
<joint name="wrist_3_joint" type="revolute">
<parent link="wrist_2_link"/>
<child link="wrist_3_link"/>
<origin rpy="0.0 0.0 0.0" xyz="0.0 0.0 0.12"/>
<axis xyz="0 1 0"/>
<limit effort="54.0" lower="-6.283185307179586" upper="6.283185307179586" velocity="6.28"/>
<dynamics damping="0.0" friction="0.0"/>
</joint>
<link name="wrist_3_link">
<visual>
<geometry>
<mesh filename="package://ur10e_description/meshes/ur10e/visual/wrist3.dae"/>
</geometry>
<material name="LightGrey">
<color rgba="0.7 0.7 0.7 1.0"/>
</material>
</visual>
<collision>
<geometry>
<mesh filename="package://ur10e_description/meshes/ur10e/collision/wrist3.stl"/>
</geometry>
</collision>
<inertial>
<mass value="0.202"/>
<origin rpy="1.5707963267948966 0 0" xyz="0.0 0.092 0.0"/>
<inertia ixx="0.00014434577559500002" ixy="0.0" ixz="0.0" iyy="0.00014434577559500002" iyz="0.0" izz="0.00020452500000000002"/>
</inertial>
</link>
<joint name="ee_fixed_joint" type="fixed">
<parent link="wrist_3_link"/>
<child link="ee_link"/>
<origin rpy="0.0 0.0 1.5707963267948966" xyz="0.0 0.117 0.0"/>
</joint>
<link name="ee_link">
<collision>
<geometry>
<box size="0.01 0.01 0.01"/>
</geometry>
<origin rpy="0 0 0" xyz="-0.01 0 0"/>
</collision>
</link>
<transmission name="shoulder_pan_trans">
<type>transmission_interface/SimpleTransmission</type>
<joint name="shoulder_pan_joint">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
</joint>
<actuator name="shoulder_pan_motor">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
<transmission name="shoulder_lift_trans">
<type>transmission_interface/SimpleTransmission</type>
<joint name="shoulder_lift_joint">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
</joint>
<actuator name="shoulder_lift_motor">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
<transmission name="elbow_trans">
<type>transmission_interface/SimpleTransmission</type>
<joint name="elbow_joint">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
</joint>
<actuator name="elbow_motor">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
<transmission name="wrist_1_trans">
<type>transmission_interface/SimpleTransmission</type>
<joint name="wrist_1_joint">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
</joint>
<actuator name="wrist_1_motor">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
<transmission name="wrist_2_trans">
<type>transmission_interface/SimpleTransmission</type>
<joint name="wrist_2_joint">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
</joint>
<actuator name="wrist_2_motor">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
<transmission name="wrist_3_trans">
<type>transmission_interface/SimpleTransmission</type>
<joint name="wrist_3_joint">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
</joint>
<actuator name="wrist_3_motor">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<robotNamespace>/ur10e</robotNamespace>
<robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
</plugin>
</gazebo>
</robot>
And controller yaml file is
ur10e:
joint_state_controller:
type: joint_state_controller/JointStateController
publish_rate: 50
shoulder_pan_joint_effort_controller:
type: effort_controllers/JointEffortController
joint: shoulder_pan_joint
pid: {p: 500.0, i: 0.01, d: 50.0, i_clamp_min: -100.0, i_clamp_max: 100.0}
shoulder_lift_joint_effort_controller:
type: effort_controllers/JointEffortController
joint: shoulder_lift_joint
pid: {p: 1000.0, i: 100.0, d: 30.0, i_clamp_min: -400.0, i_clamp_max: 400.0}
elbow_joint_effort_controller:
type: effort_controllers/JointEffortController
joint: elbow_joint
pid: {p: 10000.0, i: 0.01, d: 50.0, i_clamp_min: -100.0, i_clamp_max: 100.0}
wrist_1_joint_effort_controller:
type: effort_controllers/JointEffortController
joint: wrist_1_joint
pid: {p: 200.0, i: 10.0, d: 20.0, i_clamp_min: -400.0, i_clamp_max: 400.0}
wrist_2_joint_effort_controller:
type: effort_controllers/JointEffortController
joint: wrist_2_joint
pid: {p: 100.0, i: 0.1, d: 10.0, i_clamp_min: -100.0, i_clamp_max: 100.0}
wrist_3_joint_effort_controller:
type: effort_controllers/JointEffortController
joint: wrist_3_joint
pid: {p: 100.0, i: 0.1, d: 10.0, i_clamp_min: -100.0, i_clamp_max: 100.0}
Please let me know if you need more information!
Asked by sm3304ove on 2022-11-02 06:43:24 UTC
Answers
This seems to be enough force to move the UR10e
What tool did you get to get those values?
I did a quick check here and got approximately 121Nm for the shoulder lift and 34Nm for the elbow when the arm angles are all zero.
Precisely, [ -0. , -120.812, -33.961, -0. , 0. , 0. ]
I'm loading the UR10e URDF from the Universal_Robots_ROS2_Description
into Pinocchio and using pin.computeStaticTorque(model, data, q, fext)
Not 100% sure that's right but you might want to get a second opinion on the expected torques depending on the initial posture of the robot. If it's dangling down like pendulum the joints will absolutely move but if it's starting out lying more or less horizontal on the Gazebo floor it might not.
You might try using the position controller in Gazebo and put the robot in some pose and see what the joint efforts are.
ur_e_description
Are you building from source? Using Kinetic?
I think things changed a lot around the time of https://github.com/ros-industrial/universal_robot/issues/448 and I think that unified everything into a single ur_description
I wonder if the joint inertias are different. It's been a long time, over a year, since I was working with the ROS 1 driver in Gazebo so my memory is kind of fuzzy, but I think there were some changes to the UR10e inertias. Hopefully someone else can bring some clarity on that.
Asked by danzimmerman on 2022-11-07 23:10:32 UTC
Comments