# Problem Moving the Robot in Rviz I have written a urdf file for my differential drive mobile robot an want to make it move on rviz. I'm doing the tutorials on the book "Learning ROS for Robotic Programming" and used the codes and examples there, modifying them for myself.

So here is the urdf code;

<robot name="AGV">
<visual>
<geometry>
<box size="0.49 .82 .2"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0.01"/>
<material name="gray">
<color rgba="0 0 0 0.6"/>
</material>
</visual>

<visual>
<geometry>
</geometry>
<origin rpy="0 1.57079633 0" xyz="0.22 0 0"/>
<material name="black">
<color rgba="1 0 0 1"/>
</material>
</visual>

<visual>
<geometry>
</geometry>
<origin rpy="0 1.57079633 0" xyz="-0.22 0 0"/>
<material name="black"/>
</visual>

<joint name="base_to_wheel1" type="continuous">
<origin xyz="0 0 0"/>
<axis xyz="1 0 0"/>
</joint>

<joint name="base_to_wheel2" type="continuous">
<origin xyz="0 0 0"/>
<axis xyz="1 0 0"/>
</joint>
</robot>


#include<string>
#include<ros/ros.h>

int main(int argc, char** argv) {
ros::NodeHandle n;
ros::Rate loop_rate(30);
double angle= 0;
// message declarations
geometry_msgs::TransformStamped odom_trans;
while (ros::ok()) {
// (moving in a circle with radius 1)
odom_trans.transform.translation.x = cos(angle);
odom_trans.transform.translation.y = sin(angle);
odom_trans.transform.translation.z = 0.0;
odom_trans.transform.rotation = tf::createQuaternionMsgFromYaw(angle);
//send transform
loop_rate.sleep();
}
return 0;
}


I launch the urdf on rviz and the node, but I get the problem as; No transform from [wheel_1] to [/base_link] No transform from [wheel_2] to [/base_link]

I'm not very experienced on ROS and TF and couldn't figure out why there is no transform between two links, isn't urdf is for that?

edit retag close merge delete

Sort by » oldest newest most voted A URDF model (among others) specifies the kinematic model of your robot. For non-fixed joints (such as both wheel joints of your robot, which are continuous joints), the state (for instance rotation angle) has to be published at run-time. There's essentially two possible solutions to get rid of the warning:

• Set the type of the wheel joints to fixed instead of continuous. As the name implies, this fixes the wheel to the base and the robot_state_publisher will publish this fixed transform automatically.

• Publish a JointState message with the rotation angles of the two wheel joints

In both cases, you need to have a robot_state_publisher running, as it is reponsible for publishing the robot transforms to tf based on your URDF model (and joint_states, if it contains non-fixed joints). See the Using the robot state publisher on your own robot and Using urdf with robot_state_publisher tutorials.

more