Segmentation fault while using Hokuyo lidar with Rotors_Simulator

asked 2019-03-04 03:59:59 -0500

viswa_1211 gravatar image

updated 2019-03-04 22:35:14 -0500

I am using Ros Kinetic and Gazebo-7 on Ubuntu 16.04. I am trying to simulate a quadrotor with lidar attached to it.

I have found the Rotors_Simulator repository and manually added a Hokuyo lidar for simulation in Gazebo using the following code:

<!-- Hokuyo Lidar Range Sensor -->
    <xacro:macro name="hokuyo_utm30lx" params="robot_namespace *origin update_rate ray_count min_angle max_angle">
      <link name="${robot_namespace}/laser_lidar_link12">
    <mass value="0.001" />
    <origin xyz="0 0 0" rpy="0 0 0" />
    <inertia ixx="0.0001" ixy="0" ixz="0" iyy="0.0001" iyz="0" izz="0.0001" />
            <!--<mesh filename="package://turtlebot_description/meshes/sensors/hokuyo_utm30lx/hokuyo_utm_30lx.dae"/> -->
            <box size="0.05 0.05 0.02"/>
    <origin xyz="0 0 -0.0115" rpy="0 0 0" />
            <box size="0.058 0.058 0.087" />
            <!--<mesh filename="package://hector_sensors_description/meshes/hokuyo_utm30lx/hokuyo_utm_30lx.stl"/>-->
      <joint name="laser_lidar_joint" type="fixed">
        <origin xyz="0.0 0.0 0.12" rpy="3.14159 0.0 0.0" />
  <parent link="${robot_namespace}/base_link"/>
  <child link="${robot_namespace}/laser_lidar_link12"/>
      <gazebo reference="${robot_namespace}/laser_lidar_link12">
        <sensor type="ray" name="iris_laser_lidar">
            <pose>0 0 0 0 0 0</pose>
      <plugin name="ray" filename="">
      <!-- <interface:laser name="gazebo_ros_${laser_suffix}_iface" /> -->
 <xacro:hokuyo_utm30lx robot_namespace="${namespace}" min_angle="-1.047" max_angle="1.047"
    update_rate="40" ray_count="10">
    <origin xyz="0 0 0.5" rpy="0 0 0"/>

I could see the lidar in the simulation, and I did "rostopic echo /scan" to view the messages from the lidar. I could see the messages only when I am using an empty world for simulation. When I am adding an obstacle in the world in lidar's range, the simulation stops with the following message:

Segmentation fault (core dumped) [gazebo-2] process has died [pid 6201, exit code 139, cmd /opt/ros/kinetic/lib/gazebo_ros/gzserver -u -e ode /home/viswa/rotors_pravin/src/rotors_gazebo/worlds/ __name:=gazebo __log:=/home/viswa/.ros/log/73106ace-3e60-11e9-b4ce-bc855666be67/gazebo-2.log]. log file: /home/viswa/.ros/log/73106ace-3e60-11e9-b4ce-bc855666be67/gazebo-2*.log

Can someone suggest me what could have gone wrong?

edit retag flag offensive close merge delete