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

laser_scan(/scan) topic not showing and driving 4wheel bot using diff_drive_controller

asked 2023-07-14 01:17:15 -0600

the_one gravatar image

updated 2023-07-14 01:25:06 -0600

Hi folks, I am currently implementing a 4wheel bot. I added a laser_scan topic in urdf file, you can see the file below...when i run the launch file, i can't visualize any laser and the "/scan" topic also when i run the rostopic list. Am i doing anything wrong? this is my urdf file

` <robot <a="" href="http://xmlns:xacro="http://www.ros.org/wiki/xacro">xmlns:xacro="http://www.ros.org/wiki/..." name="my_rover"></robot>

<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 ...
(more)
edit retag flag offensive close merge delete

Comments

I suggest that you look at a project like turtlebot3 that already has all these things implemented. You can even download a complete world & simulation if you want to.

https://wiki.ros.org/turtlebot3_simul...

Mike Scheutzow gravatar image Mike Scheutzow  ( 2023-07-15 07:34:52 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-07-15 07:42:55 -0600

Mike Scheutzow gravatar image

For the simulated lidar, we use this in melodic and noetic:

  <plugin name="lidar_model" filename="libgazebo_ros_laser.so">
    <topicName>/scan</topicName>
    <frameName>scan_link</frameName>
  </plugin>

Also, having the sensor name= and the plugin name= the same might be an issue for gazebo, I'm not sure.

edit flag offensive delete link more

Comments

yes i changed that after i did not find the libgazebo_ros_ray_sensor.so file in the gazebo_ros package, also i read the gazebo documentation from gazebo... what @Mike suggested is right way to do the laser part.

the_one gravatar image the_one  ( 2023-07-17 04:00:40 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2023-07-14 01:17:15 -0600

Seen: 89 times

Last updated: Jul 15 '23