Gazebo | Ignition | Community
Ask Your Question
0

laser_scan topic didn't publishing in ROS

asked 2022-12-13 13:06:47 -0500

Olesya gravatar image

Hello, I am making the simulation with laser scan. Here is how it is descripted in sdf:

<!-----LIDAR ------->
<link name="lidar_base">
 <pose>0.000528 0.16822 1.2381 1.5708 0.013803 1.5708</pose>
 <inertial>
  <mass>1.2</mass>
  <inertia>
    <ixx>0.001087473</ixx>
    <iyy>0.001087473</iyy>
    <izz>0.001092437</izz>
    <ixy>0</ixy>
    <ixz>0</ixz>
    <iyz>0</iyz>
  </inertia>
</inertial>
<collision name='base_link_Chassis_fixed_joint_lump__Lidar_collision_1'>
   <geometry>
     <mesh>
       <scale>1 1 1</scale>
       <uri>model://stockchaser/meshes/Lidar.STL</uri>
     </mesh>
   </geometry>
 </collision>
  <visual name='base_link_Chassis_fixed_joint_lump__Lidar_visual_1'>
    <geometry>
      <mesh>
        <scale>1 1 1</scale>
        <uri>model://stockchaser/meshes/Lidar.STL</uri>
      </mesh>
    </geometry>
  </visual>
  <sensor type="ray" name="lidar_base">
    <pose>0 0 -0.004645 1.5707 0 0</pose>
    <visualize>true</visualize>
    <update_rate>30</update_rate>
  </sensor>
  <ray>
    <noise>
     <type>gaussian</type>
     <mean>0.0</mean>
    <stddev>0.1</stddev>
    </noise>
    <range>
     <min>0.05</min>
     <max>70</max>
     <resolution>0.02</resolution>
    </range>
  </ray>
  <plugin name="laser" filename="libgazebo_ros_laser.so"/>
</link>
<joint name="lidar_joint" type="fixed">
  <parent>base_link_Chassis</parent>
  <child>lidar_base</child>
  <pose>0 0 0 0 0 0</pose>
</joint>

It seems that it works in simulation, here is the screenshot:

image description

But there is no scan topic in rostopic list:

olesya@hellmachine:~$ rostopic list /clock

/gazebo/link_states

/gazebo/model_states

/gazebo/parameter_descriptions

/gazebo/parameter_updates

/gazebo/performance_metrics

/gazebo/set_link_state

/gazebo/set_model_state

/rosout

/rosout_agg

I launched ros_gazebo in verbose mode but there is no any errors connected with plugin.

This is how I am launching:

    <arg name="debug" default="true" />
    <arg name="gui" default="true" />
    <arg name="pause" default="false" />
    <arg name="world" default="$(find my_simulations)/world/empty_world.world" />
    <include file="$(find gazebo_ros)/launch/empty_world.launch">
            <arg name="world_name" value="$(arg world)" />
            <arg name="debug" value="$(arg debug)" />
            <arg name="gui" value="$(arg gui)" />
            <arg name="paused" value="$(arg pause)" />
            <arg name="use_sim_time" value="true" />
            <arg name="verbose" value="true"/>
    </include>

What should be wrong? Thank you in advance

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2022-12-21 09:33:17 -0500

Olesya gravatar image

So for future generations - I just mixed up formats. You should use URDF or xacro format

edit flag offensive delete link more
0

answered 2022-12-18 20:19:35 -0500

Veerachart gravatar image

As far as I know, this plugin is a sensor plugin, so it should be here

  <sensor type="ray" name="lidar_base">
    <pose>0 0 -0.004645 1.5707 0 0</pose>
    <visualize>true</visualize>
    <update_rate>30</update_rate>
    <plugin name="laser" filename="libgazebo_ros_laser.so"/> <!-- here -->
  </sensor>
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-12-13 13:01:26 -0500

Seen: 559 times

Last updated: Dec 21 '22