beltransen / velo2cam_gazebo

Repository including Gazebo models, plugins and worlds to test calibration algorithms for Lidar-camera setups.
http://wiki.ros.org/velo2cam_gazebo
GNU General Public License v2.0
141 stars 41 forks source link

SDF for velodyne-VLP16 with UAV #4

Closed dronecrewkari closed 6 years ago

dronecrewkari commented 6 years ago

@beltransen

Thank you for sharing SDF file for velodyne-VLP16.

I have been successful for uploading velodyne-VLP16 SDF in Gazebo,

and ROS velodyne plugin was also successful (Pointcloud2 ROS topic was displayed in RVIZ when I add the obstacle)

Lastly, I have been trying to add velodyne-VLP16 SDF with IRIS quad copter as following.

<?xml version="1.0" ?>
<sdf version='1.5'>
  <model name='iris_velodyne'>

    <include>
      <uri>model://iris</uri>
    </include> 

    <include>
      <uri>model://velodyne-VLP16</uri>
      <pose>0 0 0.1 0 0 0</pose>
        <mass>0.01</mass>
    </include>

    <joint name="velodyne_lidar" type="fixed">
      <child>velodyne-VLP16::base_footprint</child>
      <parent>iris::base_link</parent>
      <axis>
        <xyz>0 0 1</xyz>
        <limit>
          <upper>0</upper>
          <lower>0</lower>
        </limit>
      </axis>
    </joint>
  </model>
</sdf>

Following error occur, and it seems to me that gazebo cannot find the model://velodyne-VLP16.

**Error [parser.cc:581] Unable to find uri[model://velodyne-VLP16]**

IRIS and velodyne-VLP16 SDF can be uploaded in gazebo respectively, but when uploading both IRIS and velodyne-VLP16 SDF with combined SDF as shown above, the aforementioned error always occurs.

wkyoun@wkyoun-desktop:~/kari_ws$ roslaunch gazebo_ros empty_world.launch 
... logging to /home/wkyoun/.ros/log/d29c7f80-0650-11e8-9c9d-ea0e642eca7c/roslaunch-wkyoun-desktop-27616.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://wkyoun-desktop:36479/

SUMMARY
========

PARAMETERS
 * /rosdistro: kinetic
 * /rosversion: 1.12.7
 * /use_sim_time: True

NODES
  /
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)

auto-starting new master
process[master]: started with pid [27627]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to d29c7f80-0650-11e8-9c9d-ea0e642eca7c
process[rosout-1]: started with pid [27640]
started core service [/rosout]
process[gazebo-2]: started with pid [27647]
process[gazebo_gui-3]: started with pid [27661]
[ INFO] [1517380484.211421494]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1517380484.213307193]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1517380484.656524127, 0.023000000]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1517380484.695891199, 0.061000000]: Physics dynamic reconfigure ready.
^C[gazebo_gui-3] killing on exit
[gazebo-2] killing on exit

**Error [parser.cc:581] Unable to find uri[model://velodyne-VLP16]**

However, GAZEBO_MODEL_PATH was correctly defined to include IRIS and velodyne-VLP16 SDF.

wkyoun@wkyoun-desktop:~/kari_ws/src/kari_slam/models$ echo $GAZEBO_MODEL_PATH 
/home/wkyoun/kari_ws/src/mavlink_sitl_gazebo/models:/home/kari/kari_ws/src/kari_slam/models:/home/kari/kari_ws/src/kari_slam/models:/home/wkyoun/.gazebo/models

Would you please help me out to solve the problem?

dronecrewkari commented 6 years ago

I found the solution I change the model name into velodyne_VLP16 from velodyne-VLP16 in order to match the folder name, and now gazebo can find the model://velodyne_VLP16.

  <model name="velodyne_VLP16">
<?xml version='1.0'?>
<sdf version='1.6'>
  <model name="velodyne_VLP16">
      <pose frame=''>0 0 1 0 0 0</pose>
      <link name='base_footprint'>
        <pose frame=''>0 0 0 0 0 0</pose>
        <inertial>
          <pose frame=''>0 0 0 0 0 0</pose>
          <mass>2</mass>
          <inertia>
            <ixx>3.23643</ixx>
            <ixy>0.0156863</ixy>
            <ixz>0.065702</ixz>
            <iyy>3.35996</iyy>
            <iyz>-0.00821275</iyz>
            <izz>3.32745</izz>
          </inertia>
        </inertial>
        <collision name='base_footprint_collision_1'>
          <pose frame=''>0 0 -0.00185 0 0 0</pose>
          <geometry>
            <cylinder>
              <length>0.0717</length>
              <radius>0.0516</radius>
            </cylinder>
          </geometry>
          <surface>
            <contact>
              <ode/>
            </contact>
            <friction>
              <ode/>
              <torsional>
                <ode/>
              </torsional>
            </friction>
            <bounce/>
          </surface>
          <max_contacts>10</max_contacts>
        </collision>
        <visual name='base_footprint_visual_1'>
          <pose frame=''>0 0 -0.0377 0 0 0</pose>
          <geometry>
            <mesh>
              <scale>1 1 1</scale>
              <uri>model://velodyne_VLP16/meshes/VLP16_base_1.dae</uri>
            </mesh>
          </geometry>
          <material>
            <script>
              <uri>__default__</uri>
              <name>__default__</name>
            </script>
          </material>
        </visual>
        <visual name='base_footprint_visual_2'>
          <pose frame=''>0 0 -0.0377 0 0 0</pose>
          <geometry>
            <mesh>
              <scale>1 1 1</scale>
              <uri>model://velodyne_VLP16/meshes/VLP16_base_2.dae</uri>
            </mesh>
          </geometry>
          <material>
            <script>
              <uri>__default__</uri>
              <name>__default__</name>
            </script>
          </material>
        </visual>
        <visual name='base_footprint_visual_3'>
          <pose frame=''>0 0 -0.0377 0 0 0</pose>
          <geometry>
            <mesh>
              <scale>1 1 1</scale>
              <uri>model://velodyne_VLP16/meshes/VLP16_scan.dae</uri>
            </mesh>
          </geometry>
          <material>
            <script>
              <uri>__default__</uri>
              <name>__default__</name>
            </script>
          </material>
        </visual>
        <sensor name='velodyne-VLP16' type='ray'>
          <visualize>0</visualize>
          <update_rate>10</update_rate>
          <ray>
            <scan>
              <horizontal>
                <samples>1875</samples>
                <resolution>1</resolution>
                <min_angle>-3.14159</min_angle>
                <max_angle>3.14159</max_angle>
              </horizontal>
              <vertical>
                <samples>16</samples>
                <resolution>1</resolution>
                <min_angle>-0.261799</min_angle>
                <max_angle>0.261799</max_angle>
              </vertical>
            </scan>
            <range>
              <min>0.055</min>
              <max>140</max>
              <resolution>0.001</resolution>
            </range>
            <noise>
              <type>gaussian</type>
              <mean>0</mean>
              <stddev>0</stddev>
            </noise>
          </ray>
          <plugin name='gazebo_ros_laser_controller' filename='libgazebo_ros_velodyne_laser.so'>
            <topicName>/velodyne_points</topicName>
            <frameName>/velodyne</frameName>
            <min_range>0.9</min_range>
            <max_range>130.0</max_range>
            <gaussianNoise>0.008</gaussianNoise>
            <robotNamespace>/</robotNamespace>
          </plugin>
          <pose frame=''>0 0 0 0 0 0</pose>
        </sensor>
        <gravity>0</gravity>
        <self_collide>0</self_collide>
        <kinematic>0</kinematic>
      </link>
    </model>
</sdf>
beltransen commented 6 years ago

Hi, I've never faced this problem before. Thanks for sharing the solution! I'm closing this issue now. If you find any other problem, please, create a new one.

yasirAltheyabi commented 5 years ago

hi could you please share the package where you have the velodrone on the UAV?