PDA

View Full Version : URDF, Robot State Publisher, and the ArbotiX



Peter_heim
11-19-2010, 04:35 AM
Hi Fergs

I'm trying to build a urdf model of my robot i can see the robot in rviz but when i try to
start with arbotix i get the following error

process[joint_state_publisher-1]: started with pid [5453]
process[robot_state_publisher-2]: started with pid [5454]
process[map_base_link_broadcaster-3]: started with pid [5455]
[ERROR] [1290159432.635862727]: Could not compute link poses. The tree or the state is invalid.

either will work on its own but not together?
here is my launch file

<launch>

regards peter

<param name="robot_description" command="cat $(find robbie)/urdf/robbie_urdf.xml" />
<param name="/use_gui" value="False" />
<param name="/use_sim_time" value="False" />


<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
<node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />




<!-- Comment if using the base controller. -->

<node pkg="tf" type="static_transform_publisher" name="map_base_link_broadcaster" args="0 0 0 0 0 0 /map /base_link 100" />


<node name="arbotix" pkg="arbotix" type="arbotix-node.py">
<rosparam file="$(find robbie)/params/arbotix.yaml" command="load" />
</node>



</launch>

regards peter

lnxfergy
11-19-2010, 07:59 AM
Peter, we'd need to see the URDF and your ArbotiX YAML configuration file to debug this. If the URDF works stand-alone, then there is probably a mis-match between the ArbotiX joints being published and the joints defined in the URDF.

-Fergs

P.S. I believe you want to turn off that joint_state_publisher when using the ArbotiX.

Peter_heim
11-19-2010, 03:10 PM
Hi Fergs
here is my yaml file

port: /dev/ttyUSB0
rate: 15
#use_sync: False

sensors: {
"pml": {type: pml, servo_id: 1}
}

then there is probably a mis-match between the ArbotiX joints being published and the joints defined in the URDFhow are the joints published?

attached is my urdf file i had to rename it as txt to upload for some reason

regards Peter

lnxfergy
11-19-2010, 04:07 PM
Peter,

Your URDF has a couple issues that I can see. First off, the joints between base_link and base_laser are probably intended to be of type "fixed" not "continuous". Second, you'll need to publish a joint angle for any joint that is not fixed (and have at least 1 non-fixed joint) if you want to use robot_state_publisher.

The reason robot_state_publisher works with joint_state_publisher is that joint_state_publisher looks up what non-fixed joints exist, and publishes values for each one. Currently, the ArbotiX package only publishes joint angles for attached servos (those defined under "dynamixel" or "servos" in your YAML). It does not currently publish joint angles for the wheels (although I have thought about adding such an option).

-Fergs

P.S. I've moved this into it's own thread, as I think it really deserves it -- the ArbotiX 0.3.0 thread is getting a bit cluttered, and I don't want this important information to get lost in the mix.

Pi Robot
11-20-2010, 11:30 AM
Hi Fergs
here is my yaml file
how are the joints published?

attached is my urdf file i had to rename it as txt to upload for some reason

regards Peter

Hi Peter,

Following up on Fergs' observations, I've attached a modified version of your URDF file that might help get you back on track. (I commented out the wheel definitions so you can play with those on your own.) Here is the way I figured out the link/joint relationships for Pi Robot (after much trial and error and hints from Fergs):



Remember that the coordinate frames are attached to the *bottom* of the links, not the centers.
The base link needs the z-coordinate of its origin to be half the height of the base link to get the bottom flush with the ground.
When defining the other links, set the origin to have a z-coordinate equal to the height of the link below it, but leave the x and y coordinates set to 0. (You can take care of those in the joint definitions.)
In the joint definitions, set the origin to have a z-coordinate equal to the height of the link below it (just like with the link definitions). Then set the x and y coordinates to get the offset you want (if any). You will usually have to take into account the width/length or radius of the link you are displacing.
If a link needs to be rotated using the rpy definition, do it either in the link definition or the joint definition but not both. So in the case of your head link, I used rpy="0 0 1.57" in the link definition but rpy="0 0 0" in the joint definition.

With the attached URDF for Robbie and the following launch file, I can see Robbie in RViz and rotate his head with the "joint3" slider. (Note that I have set the /use_gui to True so that the joint_state_publisher pops up its GUI. Also, of course replace "pi_robot" with "robbie" whereever appropriate.)


<launch>

<param name="robot_description" command="cat $(find pi_robot)/urdf/robbie_urdf.xml" />
<param name="/use_gui" value="True" />
<param name="/use_sim_time" value="False" />

<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
<node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />

<!-- Comment if using the base controller. -->
<node pkg="tf" type="static_transform_publisher" name="odom_base_link_broadcaster" args="0 0 0 0 0 0 /odom /base_link 100" />

<!--
<node name="arbotix" pkg="arbotix" type="arbotix-node.py">
<rosparam file="$(find pi_robot)/params/params_arbotix.yaml" command="load" />
</node>
-->

</launch>To get this working with the ArbotiX node running, you'll want to comment out the joint_state_publisher (but leave the robot_state_publisher running) and make sure you have your head servo defined in your params_arbotix.yaml file. Something like this:


port: /dev/ttyUSB0
rate: 15
#use_sync: False

dynamixels: {
head_pan_joint: {id: 1, max_speed: 200}
}

controllers: {
joint_controller: {type: joint_controller, joints: [head_pan_joint] }
}--patrick

2205

Pi Robot
11-24-2010, 08:57 AM
A new detailed step-by-step URDF tutorial has just been posted on the ROS wiki by David Lu. Check it out at:

http://www.ros.org/wiki/urdf/Tutorials

--patrick

Peter_heim
12-14-2010, 03:43 AM
Hi Patrick

To get this working with the ArbotiX node running, you'll want to comment out the joint_state_publisher (but leave the robot_state_publisher running) and make sure you have your head servo defined in your params_arbotix.yaml file. Something like this:

This is probably a dumb question why comment out the joint_state_publisher with the arbotix?


peter

lnxfergy
12-14-2010, 08:31 AM
Hi Patrick

This is probably a dumb question why comment out the joint_state_publisher with the arbotix?


peter

The joint_state_publisher node publishes fake joint values -- if you have a real arbotix connected, they would conflict.

-Fergs

zhayantian
04-26-2014, 08:24 PM
Hi,
I commented out the "joint_state_publisher" as you said, but when I rosrun tf tf_echo base_link gripper_link, there was "Frame /base_footpring exist with patent NO_PARENT". Note that I'm working on a real robot(turtlebot with pincher arm), I didn't add "/use_sim_time" sentence. Thanks for your help!

zhayantian
04-26-2014, 08:48 PM
Hi,
I commented out the "joint_state_publisher" as you said, but when I rosrun tf tf_echo base_link gripper_link, there was "Frame /base_footpring exist with patent NO_PARENT". Note that I'm working on a real robot(turtlebot with pincher arm), I didn't add "/use_sim_time" sentence. Thanks for your help!