Commit 18ebafe3 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Initial commit

parents
syntax: glob
# Files generated by Eclipse
catkin/
catkin_generated/
cmake/
CMakeFiles/
devel/
gtest/
test_results/
CMakeCache.txt
cmake_install.cmake
CTestTestfile.cmake
Makefile
.cproject
.project
# Temporary files
*~
Software License Agreement (BSD License)
Copyright (c) 2015-2018, Dataspeed Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of Dataspeed Inc. nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Velodyne Simulator
URDF description and Gazebo plugins to simulate Velodyne laser scanners
![rviz screenshot](img/rviz.png)
# Features
* URDF with colored meshes
* Gazebo plugin based on [gazebo_plugins/gazebo_ros_block_laser](https://github.com/ros-simulation/gazebo_ros_pkgs/blob/kinetic-devel/gazebo_plugins/src/gazebo_ros_block_laser.cpp)
* Publishes PointCloud2 with same structure (x, y, z, intensity, ring)
* Simulated Gaussian noise
* GPU acceleration ([with a modern Gazebo build](gazebo_upgrade.md))
* Supported models:
* [VLP-16](velodyne_description/urdf/VLP-16.urdf.xacro)
* [HDL-32E](velodyne_description/urdf/HDL-32E.urdf.xacro)
* Pull requests for other models are welcome
* Experimental support for clipping low-intensity returns
# Parameters
* ```*origin``` URDF transform from parent link.
* ```parent``` URDF parent link name. Default ```base_link```
* ```name``` URDF model name. Also used as tf frame_id for PointCloud2 output. Default ```velodyne```
* ```topic``` PointCloud2 output topic name. Default ```/velodyne_points```
* ```hz``` Update rate in hz. Default ```10```
* ```lasers``` Number of vertical spinning lasers. Default ```VLP-16: 16, HDL-32E: 32```
* ```samples``` Nuber of horizontal rotating samples. Default ```VLP-16: 1875, HDL-32E: 2187```
* ```min_range``` Minimum range value in meters. Default ```0.9```
* ```max_range``` Maximum range value in meters. Default ```130.0```
* ```noise``` Gausian noise value in meters. Default ```0.008```
* ```min_angle``` Minimum horizontal angle in radians. Default ```-3.14```
* ```max_angle``` Maximum horizontal angle in radians. Default ```3.14```
* ```gpu``` Use gpu_ray sensor instead of the standard ray sensor. Default ```false```
* ```min_intensity``` The minimum intensity beneath which returns will be clipped. Can be used to remove low-intensity objects.
# Known Issues
* At full sample resolution, Gazebo can take up to 30 seconds to load the VLP-16 pluggin, 60 seconds for the HDL-32E
* With the default Gazebo version shipped with ROS, ranges are incorrect when accelerated with the GPU option ([issue](https://bitbucket.org/osrf/gazebo/issues/946/),[image](img/gpu.png))
* Solution: Upgrade to a [modern Gazebo version](gazebo_upgrade.md)
* Gazebo cannot maintain 10Hz with large pointclouds
* Solution: User can reduce number of points (samples) or frequency (hz) in the urdf parameters, see [example.urdf.xacro](velodyne_description/urdf/example.urdf.xacro)
* Gazebo crashes when updating HDL-32E sensors with default number of points. "Took over 1.0 seconds to update a sensor."
* Solution: User can reduce number of points in urdf (same as above)
* Gazebo versions in indigo and jade have different z orientations
* Solution: Maintain separate branches for urdf changes (gazebo2 and master)
# Example Gazebo Robot
```roslaunch velodyne_description example.launch```
# Example Gazebo Robot (with GPU)
```roslaunch velodyne_description example.launch gpu:=true```
# Docker image from Docker Hub
image: osrf/ros:kinetic-desktop-full
pipelines:
default:
- parallel:
- step:
name: kinetic
image: osrf/ros:kinetic-desktop-full
script:
- mkdir -p /tmp/src/repo && mv `pwd`/* /tmp/src/repo && mv /tmp/src `pwd` # Move everything into the src directory
- source `find /opt/ros -name setup.bash | sort | head -1` && echo $ROS_DISTRO # Source ROS environment
- apt update && rosdep install --from-paths src --ignore-src -y # Install dependencies missing from the docker image
- catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release
- catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --make-args tests
- catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --make-args run_tests -j1
- catkin_test_results build_isolated
- step:
name: lunar
image: osrf/ros:lunar-desktop-full
script:
- mkdir -p /tmp/src/repo && mv `pwd`/* /tmp/src/repo && mv /tmp/src `pwd` # Move everything into the src directory
- source `find /opt/ros -name setup.bash | sort | head -1` && echo $ROS_DISTRO # Source ROS environment
- apt update && rosdep install --from-paths src --ignore-src -y # Install dependencies missing from the docker image
- catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release
- catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --make-args tests
- catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --make-args run_tests -j1
- catkin_test_results build_isolated
- step:
name: melodic
image: osrf/ros:melodic-desktop-full
script:
- mkdir -p /tmp/src/repo && mv `pwd`/* /tmp/src/repo && mv /tmp/src `pwd` # Move everything into the src directory
- source `find /opt/ros -name setup.bash | sort | head -1` && echo $ROS_DISTRO # Source ROS environment
- apt update && rosdep install --from-paths src --ignore-src -y # Install dependencies missing from the docker image
- catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release
- catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --make-args tests
- catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --make-args run_tests -j1
- catkin_test_results build_isolated
branches:
gazebo2:
- step:
name: indigo
image: osrf/ros:indigo-desktop-full
script:
- mkdir -p /tmp/src/repo && mv `pwd`/* /tmp/src/repo && mv /tmp/src `pwd` # Move everything into the src directory
- source `find /opt/ros -name setup.bash | sort | head -1` && echo $ROS_DISTRO # Source ROS environment
- apt update && rosdep install --from-paths src --ignore-src -y # Install dependencies missing from the docker image
- catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release
- catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --make-args tests
- catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --make-args run_tests -j1
- catkin_test_results build_isolated
# GPU issues
The GPU problems reported in this [issue](https://bitbucket.org/osrf/gazebo/issues/946/) have been solved with this [pull request](https://bitbucket.org/osrf/gazebo/pull-requests/2955/) for the ```gazebo7``` branch. The Gazebo versions from the ROS apt repository (7.0.0 for Kinetic, 9.0.0 for Melodic) do not have this fix. One solution is to pull up-to-date packages from the OSRF Gazebo apt repository. Another solution is to compile from source: http://gazebosim.org/tutorials?tut=install_from_source
* The GPU fix was added to ```gazebo7``` in version 7.14.0
* The GPU fix was added to ```gazebo9``` in version 9.4.0
# Use up-to-date packages from the OSRF Gazebo apt repository
```
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/gazebo-stable.list'
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D2486D2DD83DB69272AFE98867170598AF249743
sudo apt update
sudo apt upgrade
```
img/gpu.png

19.2 KB

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package velodyne_description
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1.0.9 (2019-03-08)
------------------
1.0.8 (2018-09-08)
------------------
1.0.7 (2018-07-03)
------------------
* Added GPU support
* Updated inertia tensors for VLP-16 and HDL-32E to realistic values
* Removed unnecessary file extraction code in cmake
* Contributors: Kevin Hallenbeck, Max Schwarz
1.0.6 (2017-10-17)
------------------
* Use robotNamespace as prefix for PointCloud2 topic frame_id by default
* Contributors: Micho Radovnikovich
1.0.5 (2017-09-05)
------------------
* Increased minimum collision range to prevent self-clipping when in motion
* Added many URDF parameters, and set example sample count to reasonable values
* Launch rviz with gazebo
* Contributors: Kevin Hallenbeck
1.0.4 (2017-04-24)
------------------
* Updated package.xml format to version 2
* Contributors: Kevin Hallenbeck
1.0.3 (2016-08-13)
------------------
* Contributors: Kevin Hallenbeck
1.0.2 (2016-02-03)
------------------
* Moved M_PI property out of macro to support multiple instances
* Materials caused problems with more than one sensors. Removed.
* Added example urdf and gazebo
* Changed to DAE meshes
* Added meshes. Added HDL-32E.
* Start from block laser
* Contributors: Kevin Hallenbeck
cmake_minimum_required(VERSION 2.8.3)
project(velodyne_description)
find_package(catkin REQUIRED)
catkin_package()
install(DIRECTORY launch meshes rviz urdf world
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
<?xml version="1.0" ?>
<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"/>
<arg name="verbose" default="false"/>
<arg name="world_name" default="$(find velodyne_description)/world/example.world"/>
<!-- Start gazebo and load the world -->
<include file="$(find gazebo_ros)/launch/empty_world.launch" >
<arg name="paused" value="$(arg paused)"/>
<arg name="use_sim_time" value="$(arg use_sim_time)"/>
<arg name="gui" value="$(arg gui)"/>
<arg name="headless" value="$(arg headless)"/>
<arg name="debug" value="$(arg debug)"/>
<arg name="verbose" value="$(arg verbose)"/>
<arg name="world_name" value="$(arg world_name)"/>
</include>
<!-- Spawn the example robot -->
<arg name="gpu" default="false"/>
<param name="robot_description" command="$(find xacro)/xacro --inorder '$(find velodyne_description)/urdf/example.urdf.xacro' gpu:=$(arg gpu)" />
<node pkg="gazebo_ros" type="spawn_model" name="spawn_model" args="-urdf -param /robot_description -model example"/>
<node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher">
<param name="publish_frequency" type="double" value="30.0" />
</node>
<!-- RViz -->
<arg name="rviz" default="true"/>
<node if="$(arg rviz)" pkg="rviz" type="rviz" name="$(anon rviz)" respawn="false" output="screen" args="-d $(find velodyne_description)/rviz/example.rviz" />
</launch>
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment