I’m currently trying to articulate a custom robot (UR10e + Robotiq 3-Finger Gripper) via the
ros_bridge. The robot is build upon another question of mine, see: Problems adding a gripper (Robotiq 3 Finger Gripper) to an UR10
It is also attached, see bottom.
Please also see my python script at the bottom, which I’m using to control the UR10. Alas, trying to control. It is also contained in the attached zip file.
I followed the ros_bridge guide and, as far as I can tell, I get the correct joint states via
rostopic echo /joint_states. Moreover, when I change the values for a joint in
driver:angular:target, the robot moves accordingly and the
/joint_states topic is updated. The
driver:angular:targetType is set to position for all joints.
Now my problem is that the robot is not moving when I run the script.
However, using the Franka as an example with the default script, it is working just fine.
I’m using Isaac Sim 2020.2_ea inside a docker with
ros-melodic-ros-core and the ROS workspace being build.
Attachment: ur10_with_3f_gripper_ros_bridge.zip (18.6 KB)
#!/usr/bin/env python import rospy from sensor_msgs.msg import JointState import numpy as np import time import argparse parser = argparse.ArgumentParser() parser.add_argument("--mode", help="indicate control mode") args = parser.parse_args() rospy.init_node("test_rosbridge", anonymous=True) pub = rospy.Publisher("/joint_command", JointState, queue_size=10) joint_state = JointState() joint_state.name = [ "shoulder_pan_joint", "shoulder_lift_joint", "elbow_joint", "wrist_1_joint", "wrist_2_joint", "wrist_3_joint", "finger_middle_joint_1", "finger_middle_joint_2", "finger_middle_joint_3", "palm_finger_1_joint", "finger_1_joint_1", "finger_1_joint_2", "finger_1_joint_3", "palm_finger_2_joint", "finger_2_joint_1", "finger_2_joint_2", "finger_2_joint_3" ] num_joints = len(joint_state.name) # make sure kit's editor is playing for receiving messages ## if args.mode == "position": joint_state.position = np.array([0.0] * num_joints) default_joints = [0.0, -1.5705, 0.0, 0.0, 0.0, 0.0, 0.05, 0.0, -0.05, 0.0, 0.05, 0.0, -0.05, 0.0, 0.05, 0.0, -0.05] # limiting the movements to a smaller range (this is not the range of the robot, just the range of the movement max_joints = np.array(default_joints) + 0.5 min_joints = np.array(default_joints) - 0.5 # position control the robot to wiggle around each joint time_start = time.time() rate = rospy.Rate(20) while not rospy.is_shutdown(): joint_state.position = np.sin(time.time() - time_start) * (max_joints - min_joints) * 0.5 + default_joints pub.publish(joint_state) rate.sleep() elif args.mode == "velocity": rate = rospy.Rate(0.5) joint_state.position =  joint_state.velocity = np.array([-0.7] * num_joints) while not rospy.is_shutdown(): pub.publish(joint_state) rate.sleep() joint_state.velocity = -joint_state.velocity else: print("control mode error")