Skip to content
Jesse Haviland edited this page Jan 18, 2021 · 4 revisions

Work in progress (not implemented)

The toolbox can control a real robot through ROS.

User side

The ROS backend is created as usual by

env = rtb.backends.ros()

and the actual driver is created with

# This will launch a ros core, or connect to local roscore, or a remote roscore
env.launch(core=True, ros_master_uri='http://localhost:11311', ros_ip=192.168.0.1)

where roscore can be started or the toolbox can use an existing roscore. If roscore is running remotely, the URI and IP can be supplied via arguments to the launch function.

From here we can make our robot object as usual

# Make a Panda
panda = rtb.models.Panda()

and then we must add it to the environment as we would with a different backend

env.add(panda, state_topic, connector, vel_topic)
  • state_topic is the name of a ros topic which is publishing the robot state.
  • connector is a function which takes in the data recieved by state_topic and stores the relevent robot state information. This needs to happen because we cannot anticipate a universal message structure for all avaliable manipulators.
  • vel_topic is the name of the topic to publish joint velocity commands to.

Behind the scenes

We can have rospy and rospkg as dependencies for the toolbox which allows us to use ros methods.

Through multithreading we can create a ros node which can publish velocity commands at a specific rate to the desired vel_topic.

Through another thread we can have a subscriber which listens to state_topic and returns useful robot state information.

Issues

How to get updates from robot.qd to the publisher?

We can use a Queue and perhaps wrap the setter to send the updated qd values to the publisher.

Instead use the step() method to update the qd being sent to the robot.