compas_fab icon indicating copy to clipboard operation
compas_fab copied to clipboard

wrapper for getting the current robot configuration

Open xarthurx opened this issue 6 years ago • 1 comments

There's no method for getting the current robot position. Just put here for reference.

xarthurx avatar Apr 24 '19 06:04 xarthurx

For the moment use this:

from roslibpy import Topic
listener = Topic(client, '/joint_states','sensor_msgs/JointState')
def callback(message):
   print("joint_states", message["position"])
listener.subscribe(callback)

There are 2 ways of checking the rostopics and their types:

  1. Use ROS commands: To get a list of available topics you can type in the following command rostopic list. To get the type of the topic /joint_states, use the command rostopic info /joint_states
  2. Use RosClient: client.get_topics(callback) will receive a dictionary with 2 keys: a list of 'topics' and a list of 'types'

romanarust avatar Apr 24 '19 10:04 romanarust