ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

No transform from [front_left_wheel] to [base_link]

asked 2022-04-19 16:14:51 -0600

elif gravatar image

hi, i'm trying to add wheels to base link on rviz, but i can't solve that error RobotModel/StatusError/No transform from [front_left_wheel] to [base_link]

In terminal there is an error too: i wrote codes from github/qboticslabs/qboticslabs_website (In my launch, state_publisher is written)

dif_robot.xacro

<robot <a="" href="http://xmlns:xacro="http://www.ros.org/wiki/xacro%22" name="dif_robot">xmlns:xacro="http://www.ros.org/wiki/...></robot>

<xacro:include filename="$(find pan_tilt)/urdf/wheel.xacro" />


<!-- renk tanımlama -->
<material name="Black">
    <color rgba="0.0 0.0 0.0 1.0"/>
</material>   
<material name="White">
    <color rgba="1.0 1.0 1.0 1.0"/>
</material> 
<material name="Red">
    <color rgba="0.8 0.0 0.0 1.0"/>
</material> 
<material name="Blue">
    <color rgba="0.0 0.0 1.0 1.0"/>
</material> 

<property name="M_PI" value="3.1415926535897931" />
<property name="M_PI_2" value="1.570796327" />
<property name="DEG_TO_RAD" value="0.017453293" />

<property name="base_height" value="0.02" />
<property name="base_radius" value="0.15" />
<property name="base_mass" value="5" />

<property name="caster_f_height" value="0.04" />
<property name="caster_f_radius" value="0.025" />
<property name="caster_f_mass" value="0.5" />

<property name="caster_b_height" value="0.04" />
<property name="caster_b_radius" value="0.025" />
<property name="caster_b_mass" value="0.5" />

<property name="wheel_mass" value="2.5" />

<property name="base_x_origin_to_wheel_origin" value="0.25" />
<property name="base_y_origin_to_wheel_origin" value="0.3" />
<property name="base_z_origin_to_wheel_origin" value="0.0" />

<property name="hokuyo_size" value="0.05" />

<macro name="cylinder_inertia" params="m r h">
<inertia ixx="${m*(3*r*r+h*h)/12}" ixy="0.0" ixz="0.0" 
iyy="${m*(3*r*r+h*h)/12}" iyz="0.0"
izz="${m*r*r/2}"/>
</macro>

<!--base_footprint-->
<link name="base_footprint">
    <inertial>
        <origin xyz="0.0 0.0 0.0"/>
        <mass value="0.0001"/>
        <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
        iyy="0.0001" iyz="0.0" 
        izz="0.0001"/>
    </inertial>
    <visual>
        <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
        <geometry>
            <box size="0.001 0.001 0.001"/>
        </geometry>
    </visual>
</link>

<gazebo reference="base_footprint">
    <turnGravityOff>false</turnGravityOff>
</gazebo>

<joint name="base_footprint_joint" type="fixed">
    <origin xyz="0.0 0.0 ${wheel_radius - base_z_origin_to_wheel_origin}" rpy="0.0 0.0 0.0"/>
    <parent link="base_footprint"/>
    <child link="base_link"/>
</joint>

<!-- base link -->
<link name="base_link">
    <inertial>
        <origin xyz="0.0 0.0 0.0"/>
        <mass value="${base_mass}"/>
        <cylinder_inertia m="${base_mass}" r="${base_radius}" h="${base_height}"/>
    </inertial>

    <visual>
        <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
        <geometry>
            <cylinder length="${base_height}" radius="${base_radius}"/>
        </geometry>
        <material name="White"/>
    </visual>

    <collision>
        <origin xyz="0.0 0 ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
1

answered 2022-04-22 05:11:04 -0600

Robo_guy gravatar image

updated 2022-04-22 05:11:40 -0600

Hi, I think the error could be coming because of missing gazebo plugin. Adding this should solve your issue -

<gazebo>
        <plugin name="joint_state_publisher" filename="libgazebo_ros_joint_state_publisher.so">
            <jointName>left_wheel,right_wheel</jointName>
        </plugin>
</gazebo>
edit flag offensive delete link more
1

answered 2022-04-22 06:27:06 -0600

Joe28965 gravatar image

Basically, robot_state_publisher only broadcasts static joints. The joint for the wheels is dynamic, so RSP will skip that one.

As to how you can get the TF for your wheels. There are several options.

The first one is adding the joint_state_publisher as suggested by @Robo_guy. This is a gazebo_ros plugin that gets the position of the join in Gazebo and broadcasts it to the TF tree.

You can also do it using the differential drive plugin from gazebo_ros. This is a plugin that allows you to drive the robot around (using teleop for instance). It has the option to broadcast the odom and wheel TFs.

You could also use ros_control, but it's a bit tricky to do in ROS 1 in simulations (at least in my opinion).

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-04-19 15:45:24 -0600

Seen: 1,153 times

Last updated: Apr 22 '22