[ros-users] Getting /smart_arm_controller/state from the UA Smart Arm Controller
Antons Rebguns
anton at email.arizona.edu
Mon Dec 13 18:16:25 UTC 2010
Hi Patrick,
I am trying out the UA Smart Arm Controller package with my robot which
> has a pair of AX-12+ arms, pan and tilt head servos, and a torso joint,
> all controlled on a single Dynamixel bus via a USB2Dynamixel controller.
> I'm not sure the smart arm controller was meant to be used this way
> (as a general joint controller for the whole robot) but so far it seems
> to be working, meaning, I can move each joint by publishing to the
> appropriate topic and I can read the states of each servo on the
> appropriate topics.
>
It was really meant to be a general Dynamixel controller, be it the SmartArm
or just pan/tilt joints anywhere on the robot. You just define a controller
for each joint (e.g. a pan joint on the robot head or shoulder pitch joint
in SmartArm), specify which motors drive this joint, what their min/max/home
encoder position are, etc. There's really nothing specific to SmartArm.
>
> The one discrepancy I have run into between the documentation and what I
> am seeing on my machine is trying to get the joint state for all joints
> as referred to in the tutorial at:
>
>
> http://www.ros.org/wiki/smart_arm_controller/Tutorials/Getting%20Started%20with%20a%20Smart%20Arm
>
> Near the bottom of the tutorial it is claimed that I can get the
> joint_states with the following command:
>
> rostopic echo /smart_arm_controller/state
>
> but this topic does not exist. I can get a list of motor states with
> the command:
>
> rostopic echo /motor_states/ttyUSB0
>
> but this topic does not include the joint names which I will need if I
> want to see the state changes in RViz via the robot_state_publisher and
> my URDF model.
>
>
I changed how the driver operates quite a bit in the last few weeks, I still
need to update the documentation to reflect all these changes. The addition
of port name to topic names was to allow for multiple serial buses
controlling the servos. I have 3 serial buses with a bunch of Dynamixels
attached to each and I have 3 motor_states topics (e.g.
/motor_states/upper_arm, /motor_states/lower_arm, /motor_states/head).
The /motor_states/* topics is the lowest level information that comes from
the motors, it includes things like voltage, temperature and everything is
still servo encoder units. This topic is published by the lowest level motor
driver which doesn't know how servos are assembled into joints (some joints
can be driven by multiple servos, SmartArm has two joints like that). For
that we define a controller which will translates encoder units into actual
angle in radians based on the home encoder position, etc. It also publishes
joint state information on /controller_namespace/state, which includes
joint_name and everything is translated to ROS units (radians for angles,
rad/s for velocities, etc.) and advertises a /controller_namespace/command
topic through which you can control the joint.
> So my question is: how can I get a list of joint states including joint
> names?
>
>
So what you have is a bunch of /*/state topics, one for each controller.
What I usually do next is write a node that subscribes to all of them and
publishes a single joint_states message that robot_state_publisher
subscribes to. Look here for an example:
http://code.google.com/p/ua-ros-pkg/source/browse/trunk/arrg/ua_apps/wubble2_robot/nodes/joint_states_publisher.py?r=1032
I probably should write a generic node that will subscribe to specified
controllers and publish a joint_states topic.
> Here is my full setup in case it helps:
> <snip>
>
Your config files look fine to me.
Let me know if that helps,
Anton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20101213/4ae95743/attachment-0003.html>
More information about the ros-users
mailing list