0
$\begingroup$

Rosanswers logo

Hello everyone, So i am having this error

[ERROR] [1689583588.994400924, 0.150000000]: Wheel link front_left_wheel is NOT modeled as a cylinder or sphere!
[ERROR] [1689583588.994569868, 0.150000000]: Couldn't retrieve front_left_wheel_joint wheel radius
[ERROR] [1689583588.994729367, 0.150000000]: Failed to initialize the controller
[ERROR] [1689583588.995644288, 0.150000000]: Initializing controller 'my_rover_diff_drive_controller' failed
[ERROR] [1689583590.002104, 0.353000]: Failed to load my_rover_diff_drive_controller

when i run the launch file.... the wheel part is i added a mesh file instead of cylinder or sphere. the diff_drive_controller part i don't have any idea about why that error showing... I will attach my files below for your reference...

rover.urdf

<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="my_rover">

    
    <xacro:property name="constant"     value = "0.083333333"/> #1/12
    <xacro:property name="mass"         value = "0.5"/>
    <xacro:property name="width"        value = "0.75"/> 
    <xacro:property name="height"       value = "0.15"/>
    <xacro:property name="depth"        value = "0.4"/>
    <xacro:property name="radius"        value = "0.033"/>
    <xacro:property name="length"        value = "0.018"/>

    <!-- rover base link -->
    <link name="world"/>


    <joint name="Chassis_joint" type="fixed">
        <parent link="world"/>
        <child link="Chassis"/>
        <origin xyz="0.0 0.0 0.135" rpy="0.0 0.0 0.0"/>
        <axis xyz="0.0 0.0 0.0"/>       
    </joint>
    
    <link name="Chassis">

        <inertial> 
            <mass value="0.5"/>
            <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
            <inertia ixx="0.007601" ixy="0.0" ixz="0.0" 
                     iyy="0.03009" iyz="0.0" 
                     izz="0.024365"/>
        </inertial>
        <visual>
            <geometry>
                <box size="0.75 0.4 0.15" />
            </geometry>
            <material name="">
                <color rgba="1.0 0.3 0.1 1.0"/>
            </material>
        </visual>
        <collision>
            <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
            <geometry>
                <box size="0.75 0.4 0.15" />
            </geometry>
        </collision>
    </link>

    <gazebo reference = "Chassis">
        <material> Gazebo/Orange </material>
    </gazebo> 

        <!-- camera/sensor mount -->
    <joint name="mount_joint" type="fixed">
        <parent link="Chassis"/>
        <child link="mount_link"/>
        <origin xyz="0.2 0.0 0.124" rpy="0.0 0.0 0.0"/>
        <axis xyz="0.0 0.0 0.0"/> 
    </joint>

    <link name="mount_link">
        <inertial>
            <mass value="0.0"/>
            <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
            <inertia ixx="0.0" ixy="0.0" ixz="0.0"
                    iyy="0.0" iyz="0.0"
                    izz="0.0" />
        </inertial>  
        <visual>                     
            <geometry>
                <cylinder radius="0.08" length="0.1"/>
            </geometry>
            <material name="">
                <color rgba="0.0 0.0 0.0 1.0"/>
            </material>
        </visual>
        <collision>
            <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
            <geometry>
                <cylinder radius="0.08" length="0.1"/>
            </geometry>
        </collision>
    </link> 

    <gazebo reference = "mount_link">
        <material> Gazebo/Black</material>
    </gazebo>  

    <!-- defining xacro style for repeating elements -->
    <xacro:macro name="wheel" params="name path x y">
        
        <joint name="${name}_wheel_joint" type="continuous">
            <parent link="Chassis"/>
            <child link="${name}_wheel"/>
            <origin xyz="${x} ${y} 0.0" rpy="0.0 0.0 0.0"/>
            <axis xyz="0.0 1.0 0.0"/> 
        </joint>
        
        <link name="${name}_wheel">
            <inertial>
                <mass value="0.5"/>
                <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
                <inertia ixx="0.00042" ixy="0.0" ixz="0.0"
                        iyy="0.00014" iyz="0.0"
                        izz="0.00063" />
            </inertial>             
            <visual>           
                <geometry>
                    <mesh filename="${path}" scale="0.005 0.005 0.005"/> #length = 0.018 radius = "0.066"
                </geometry>
                <material name="">
                    <color rgba="1.0 0.0 0.0 1.0"/>
                </material>
            </visual>
            <collision>
                <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
                <geometry>
                    <mesh filename="${path}" scale="0.005 0.005 0.005"/>
                </geometry>
            </collision>

        </link>

        <gazebo reference = "${name}_wheel">
            <material> Gazebo/Red </material>
            <mu1 value="200.0"/>
            <mu2 value="100.0"/>
            <kp value="10000000.0" />
            <kd value="1.0" />
        </gazebo>  

        <transmission name="${name}_wheel_trans">
            <type>transmission_interface/SimpleTransmission</type>
            <actuator name="${name}_wheel_motor">
                <mechanicalReduction>1</mechanicalReduction>
            </actuator>
            <joint name="${name}_wheel_joint">
                <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
            </joint>
        </transmission>
    </xacro:macro>


    <!-- wheel creating using macros -->
    <xacro:wheel name = "front_left" path ="package://mobile_robot/meshes/right_tire.stl" x = "0.187" y = "0.25"/>
    <xacro:wheel name = "front_right" path ="package://mobile_robot/meshes/left_tire.stl" x = "0.187" y = "-0.25"/>
    <xacro:wheel name = "rear_left" path ="package://mobile_robot/meshes/right_tire.stl" x = "-0.187" y = "0.25"/>
    <xacro:wheel name = "rear_right" path ="package://mobile_robot/meshes/left_tire.stl" x = "-0.187" y = "-0.25"/>

</robot>

this is my diff_drive_controller.yaml file

    type: "diff_drive_controller/DiffDriveController"
publish_rate: 50

left_wheel: ['front_left_wheel_joint', 'rear_left_wheel_joint']
right_wheel: ['front_right_wheel_joint', 'rear_right_wheel_joint']

wheel_separation: 0.4

pose_covariance_diagonal: [0.001, 0.001, 0.001, 0.001, 0.001, 0.03]
twist_covariance_diagonal: [0.001, 0.001, 0.001, 0.001, 0.001, 0.03]

# Top level frame (link) of the robot description
base_frame_id: Chassis

# Velocity and acceleration limits for the robot
linear:
  x:
    has_velocity_limits    : true
    max_velocity           : 0.2   # m/s
    has_acceleration_limits: true
    max_acceleration       : 0.6   # m/s^2
angular:
  z:
    has_velocity_limits    : true
    max_velocity           : 2.0   # rad/s
    has_acceleration_limits: true
    max_acceleration       : 6.0   # rad/s^2

gazebo.launch file

<?xml version="1.0"?>
<launch>
    
    <rosparam file="$(find mobile_robot)/config/diff_drive_controller.yaml" command="load" ns = "my_rover_diff_drive_controller"/>

    <rosparam file="$(find mobile_robot)/config/joint_state_controller.yaml" command="load" ns = "my_rover_joint_state_controller"/>
    
    <param name="robot_description" command="xacro '$(find mobile_robot)/urdf/rover.urdf.xacro'"/>

    <arg name="rviz_config_file" default="$(find mobile_robot)/config/robot_config.rviz"/>

    <node name="my_rover_controller_spawner" pkg="controller_manager" type="spawner"
        args="   my_rover_joint_state_controller
                my_rover_diff_drive_controller" />
        
    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output = "screen"/>
    
    <node pkg="rviz" type="rviz" name="rviz" args = "-d $(arg rviz_config_file)"/>

    
    <include file="$(find gazebo_ros)/launch/empty_world.launch">
        <arg name="paused" default="false"/>
        <arg name="use_sim_time" default="true"/>
        <arg name="gui" default="true"/>
        <arg name="headless" default="false"/>
        <arg name="debug" default="false"/>
    </include>

    <node name="spawning_lidar" pkg="gazebo_ros" type="spawn_model" args="-urdf -param robot_description -model my_rover" />

    <node name="rqt_robot_steering" pkg="rqt_robot_steering" type="rqt_robot_steering">
        <param name="default_topic" value="/my_rover/cmd_vel"/>
    </node>

</launch>

how can i solve those? what did i do wrong?


Originally posted by the_one on ROS Answers with karma: 41 on 2023-07-17

Post score: 0


Original comments

Comment by the_one on 2023-07-18:
I changed the wheel tag like this

<collision>
     <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
     <geometry>
           <cylinder radius="${radius}" length="${length}"/>
     </geometry>
</collision>

it solved both the issue. But i face this issue in robot model in rviz for the world status like this "No transform [world] to [odom]". the bot is moving in rviz when i change the rqt_steering console, but the bot don't move in gazebo(wheels are running). And the generated view_frames.pdf file don't have world frame even tho i gave the link in urdf file.

Comment by bluegiraffe-sc on 2023-07-18:
Hi!

Glad you solved! Please post the solution to the original issue as an answer instead of a comment. Then open a new question for the new issue you have found.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

i changed the wheel tag like this

 <visual>           
     <geometry>
              <mesh filename="${path}" scale="0.005 0.005 0.005"/>
     </geometry>
      <material name="">
           <color rgba="1.0 0.0 0.0 1.0"/>
      </material>
 </visual>    
<collision>
         <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
         <geometry>
               <cylinder radius="${radius}" length="${length}"/>
         </geometry>
    </collision>

it solved both the issue. Hope it helps someone in the future someone facing the same problem.


Originally posted by the_one with karma: 41 on 2023-07-18

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.