Ask Your Question

Connecting your Wheels in URDF to ROS

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

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

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

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" />

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



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 image FrozenCh  ( 2017-02-02 21:19:42 -0500 )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"/>
burf2000 gravatar image burf2000  ( 2017-02-05 14:44:20 -0500 )edit

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 image FrozenCh  ( 2017-02-05 20:03:40 -0500 )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 image burf2000  ( 2017-02-06 01:52:36 -0500 )edit

The joint type for wheel should be continuous. You can see this as reference.

FrozenCh gravatar image FrozenCh  ( 2017-02-06 02:20:21 -0500 )edit

Thanks mate :)

burf2000 gravatar image burf2000  ( 2017-02-06 02:57:51 -0500 )edit

Still not working :(

burf2000 gravatar image burf2000  ( 2017-02-10 15:26:46 -0500 )edit

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

burf2000 gravatar image burf2000  ( 2017-02-18 02:03:07 -0500 )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



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

Seen: 1,133 times

Last updated: Feb 02 '17