Ask Your Question
1

Connecting your Wheels in URDF to ROS

asked 2017-02-02 09:59:55 -0600

burf2000 gravatar image

So, there is some definite gaps in my ROS knowledge, thanks to the awesome people on here I have nearly got to where I need to. I have a custom robot, that has hector slam and navigation kinda working :)

I am now adding a URDF model to it so it is easier to see where the sensors are etc. My robot model starts with Base_frame, which has laser, lwheel, rwheel hanging off of it. When I move my robot, the laser and baseframe move, however the wheels do not.

Do I need to publish a JointState Message for the wheels? how do I go about this. my /odom (odom_frame) is created by hector slam

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-02-02 19:30:49 -0600

Mark Rose gravatar image

You need to make sure you have fixed joints in the URDF between the wheel frames and the robot base frame so that the wheels will move along with the base. If you do that, then updates to the robot position will cause simultaneous updates to the wheel frame positions. Something like this:

<link name="base_link"> ... </link>
<link name="left_wheel_link"> ... </link>
<joint name="base_to_left_wheel" type="fixed">
    <parent link="base_link" />
    <child link="left_wheel_link" />
    <origin xyz="0.0 -0.1 -0.02" />
</joint>

This places the left wheel frame 100mm to the left of robot center and 20mm down (-Z). Similar for the right wheel. Note that by convention the base_link frame has the X axis pointing straight ahead, the Y axis pointing to the left of the robot, and the Z axis pointing up.

You might also need the "rpy=" attribute to <origin> if you need the wheel frame orientation to be different than base_link. (Often not needed for fixed frames which are not sensor locations.)

edit flag offensive delete link more

Comments

1

If he checked that fixed type is okay with his robot and wheel, I think the next step is to change the type from "fixed" to "continuous" so that he can use the "differential_drive_controller" plugin.

FrozenCh gravatar imageFrozenCh ( 2017-02-02 21:19:42 -0600 )edit

So I already have fixed in the link, however what is the differential_drive_controller and what do I need it for

 <joint name="base_to_lwheel" type="fixed">
    <parent link="base_frame"/>
    <child link="lwheel"/>
    <origin xyz="0 0.085 0.07" rpy="1.5708 0 0"/>
  </joint>
burf2000 gravatar imageburf2000 ( 2017-02-05 14:44:20 -0600 )edit
2

differential_drive_controller is a plug, by using which we can use cmd_vel, a common topic name for navigation stack, to control your robot model in Gazebo. However, if you just need a model appearance in rviz, then never mind the plugin.

FrozenCh gravatar imageFrozenCh ( 2017-02-05 20:03:40 -0600 )edit

Thank you, should I still change the fixed to continuous? I am just a little confused in Rviz what connects to the wheels (except the URDF)

burf2000 gravatar imageburf2000 ( 2017-02-06 01:52:36 -0600 )edit
1

The joint type for wheel should be continuous. You can see this as reference. http://wiki.ros.org/urdf/XML/joint

FrozenCh gravatar imageFrozenCh ( 2017-02-06 02:20:21 -0600 )edit

Thanks mate :)

burf2000 gravatar imageburf2000 ( 2017-02-06 02:57:51 -0600 )edit

Still not working :(

burf2000 gravatar imageburf2000 ( 2017-02-10 15:26:46 -0600 )edit

I needed to also add node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher">

burf2000 gravatar imageburf2000 ( 2017-02-18 02:03:07 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2017-02-02 09:59:55 -0600

Seen: 679 times

Last updated: Feb 02 '17