ROS bridge with custom robot not working

Hi,

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.

Any ideas?

Thank you,

Johann

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")

Hi Johann,

You python script looks fine. and thanks for providing the files so we can repro the problem. Just a note, in the future, when you are downloading a usd file, you should right click on the file in the “content” tab at the bottom, and “Collect Asset”. This way, it’ll collect all the relevant reference files. For example, your usd actually included two reference assets, the ur10 and the gripper. Without those reference assets, we actually can’t open just the final usd file. But thankfully you pointed us to a previous issue you had on the forum, so we were able to load your assets based on the earlier info.

Now the problem you are running into is most likely coming from your physicsScene setup. Go to the Stage tree, open physicsScene, in the Details tab, switch broadphaseType to “MBP” and uncheck enableGPUDynamics . the dyanmics control extension that’s used to set the robot’s joints are not yet optimized for GPU, so don’t use it yet. That should solve your problem. And also a side note, we tend to use “TGS” solvers for articulated robots.

Let us know how that goes.

1 Like

Hi,

Btw, where can I find detailed information about the physicsScene and its configuration?

Hi @qwan,

thank you for your replay!
I was able to fix my problem, now everything is working fine :)

One small question though, will it be possible, in a future release, to control the joint via effort?

Thank you,

Johann

PS: I’ll make sure my usd will contain the whole modell in the future :)

Hi @johann.lange, did you by any chance get to extend this to work also in a real UR10?

Hi @saralopez,

unfortunately not. We ran into some limitations of Isaac, e.g. not being able to stream more than one camera image.
Thus, we switched to Gazebo for the time being.

Cheers

Hi
johann.lange

Sorry to hear that. We will have multi camera supported in our next release.

Liila

1 Like