Skip to content

Commit

Permalink
ira_laser_tools upload
Browse files Browse the repository at this point in the history
  • Loading branch information
seunggeon authored Mar 30, 2022
1 parent 6c9a043 commit 352f15a
Show file tree
Hide file tree
Showing 11 changed files with 914 additions and 0 deletions.
63 changes: 63 additions & 0 deletions src/ira_laser_tools/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package ira_laser_tools
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1.0.4 (2020-02-14)
------------------
* fix worning
"<command-line>:0:0: warning: missing whitespace after the macro name"
* change email maintainer
* Contributors: Pietro Colombo

1.0.3 (2020-02-13)
------------------
* fix `#14 <https://github.com/iralabdisco/ira_laser_tools/issues/14>`_
now we use math library for pi
* bugfix
* Merge branch 'kinetic'
* fix issue fix`#14 <https://github.com/iralabdisco/ira_laser_tools/issues/14>`_
* Create LICENSE
* Create LICENSE
* Merge pull request `#11 <https://github.com/iralabdisco/ira_laser_tools/issues/11>`_ from mikaelarguedas/patch-1
add libvtk-qt dependency to fix debian stretch builds
* add libvtk-qt dependency to fix debian stretch builds
* Contributors: Mikael Arguedas, Pietro Colombo, pietrocolombo

1.0.2 (2018-08-28)
------------------
* add libvtk-qt dependency to fix debian stretch builds
and link to paper in README.md
* Contributors: Pietro Colombo

1.0.1 (2018-07-18)
------------------

1.0.0 (2018-07-11 10:30:16 +0200)
---------------------------------
* add url for wiki in pakage.xml
* adding license
* introduce a param in param file
expand the range limit of laser
and minor bug fix
* Merge pull request `#1 <https://github.com/iralabdisco/ira_laser_tools/issues/1>`_ from leonziegler/installprocedure
Added possibility to install artifacts.
Merged. Thanks :-)
* Merge branch 'master' of projects.ira.disco.unimib.it:/repository/git/ira_laser_tools
Conflicts:
CMakeLists.txt
* this commit fixes `#265 <https://github.com/iralabdisco/ira_laser_tools/issues/265>`_ @5m
* Fixed the Eigen3 required in the CMakeLists.txt
* updating readme
* removing eigen dependency
* Update laserscan_virtualizer.launch
description of base_frame param. updated
* Added possibility to install artifacts.
* changes to README.md
* global refactoring
* Merge branch 'master' of https://github.com/iralabdisco/ira_laser_tools
* going to version 1.0; useful tutorial on .launch file for laservirtualizer; the overall virtualscanner procedure is now simpler
* First README.md version
* adding readme file
* Fixed the include bug
* First commit
* Contributors: Augusto Luis Ballardini, Axel Furlan, Fabio Nava, Iralab Universita Milano Bicocca, Leon Ziegler
152 changes: 152 additions & 0 deletions src/ira_laser_tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
cmake_minimum_required(VERSION 2.8.3)
project(ira_laser_tools)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS laser_geometry roscpp sensor_msgs std_msgs tf dynamic_reconfigure pcl_ros)

find_package(Eigen3 REQUIRED)

find_package(PCL REQUIRED)

# bugfix for g++-Warning
# "<command-line>:0:0: warning: missing whitespace after the macro name"
remove_definitions(-DDISABLE_LIBUSB-1.0)

generate_dynamic_reconfigure_options(cfg/laserscan_multi_merger.cfg cfg/laserscan_virtualizer.cfg)


## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)


## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/groovy/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()

#######################################
## Declare ROS messages and services ##
#######################################

## Generate messages in the 'msg' folder
# add_message_files(
# FILES
# Message1.msg
# Message2.msg
# )

## Generate services in the 'srv' folder
# add_service_files(
# FILES
# Service1.srv
# Service2.srv
# )

## Generate added messages and services with any dependencies listed here
# generate_messages(
# DEPENDENCIES
# sensor_msgs# std_msgs
# )

###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
INCLUDE_DIRS
# LIBRARIES laser_merger
# CATKIN_DEPENDS laser_geometry roscpp sensor_msgs std_msgs tf
# DEPENDS system_lib
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(include
${catkin_INCLUDE_DIRS}
${EIGEN_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
)

#add_definitions(${EIGEN_DEFINITIONS})

## Declare a cpp library
# add_library(laser_merger
# src/${PROJECT_NAME}/laser_merger.cpp
# )

## Declare a cpp executable
#add_executable(laser_merger_node src/laser_merger_node.cpp)
#target_link_libraries(laser_merger_node ${catkin_LIBRARIES})

add_executable(laserscan_multi_merger src/laserscan_multi_merger.cpp)
target_link_libraries(laserscan_multi_merger ${catkin_LIBRARIES} ${PCL_LIBRARIES})

## Add cmake target dependencies of the executable/library
## as an example, message headers may need to be generated before nodes
add_dependencies(laserscan_multi_merger ${PROJECT_NAME}_gencfg)

add_executable(laserscan_virtualizer src/laserscan_virtualizer.cpp)
target_link_libraries(laserscan_virtualizer ${catkin_LIBRARIES} ${PCL_LIBRARIES})

## Add cmake target dependencies of the executable/library
## as an example, message headers may need to be generated before nodes
add_dependencies(laserscan_virtualizer ${PROJECT_NAME}_gencfg)

## Specify libraries to link a library or executable target against


#############
## Install ##
#############

# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/groovy/api/catkin/html/adv_user_guide/variables.html

## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# install(PROGRAMS
# scripts/my_python_script
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark executables and/or libraries for installation
install(TARGETS laserscan_multi_merger laserscan_virtualizer
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

## Mark cpp header files for installation
# install(DIRECTORY include/${PROJECT_NAME}/
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
# FILES_MATCHING PATTERN "*.h"
# PATTERN ".svn" EXCLUDE
# )

## Mark other files for installation (e.g. launch and bag files, etc.)
install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
)

#############
## Testing ##
#############

## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_laser_merger.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()

## Add folders to be run by python nosetests
# catkin_add_nosetests(test)
29 changes: 29 additions & 0 deletions src/ira_laser_tools/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2019, Iralab
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. 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.

3. Neither the name of the copyright holder 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.
30 changes: 30 additions & 0 deletions src/ira_laser_tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
This library includes some tools for laser handling in ROS. At the moment two nodes are available:

- laserscan_multi_merger
- laserscan_virtualizer

Both use part of the pointcloud_to_laserscan code available in ROS.

Laserscan_merger allows to easily and dynamically (rqt_reconfigure) merge multiple, same time,
single scanning plane, laser scans into a single one; this is very useful for using applications
like gmapping, amcl, pamcl on vehicles with multiple single scanning plane laser scanners, as these
applications require just one laser scan as input. The scanning planes need to be approximately the
same. The resulting scan will appear generated from a single scanner dis-regarding actual
occlusions as seen from the merged scans; for instance, consider the case of 2 scanners mounted on
the 2 front corners A and B of a rectangular vehicle (we live in 2D); each scanner gives out a
270degs scan, from along the long side of the vehicle going backward to toward the other scanner.
The merged scan will appear as generated from a virtual scanner positioned in C, halfway A and B,
and measuring the same measures of the merges scans, irregardless of the occlusions that would
apply to a real scanner positioned in C.

Laserscan_virtualizer allows to easily and dynamically (rqt_reconfifure) generate virtual laser
scans from a pointcloud such as the one generated by a multiple scanning plane laser scanner, e.g.,
a velodyne scanner). The only requirement is the rototranslation between the virtual laser scanner
and the base frame to be known to TF.

The documentation is at the moment very brief, for any question please contact us at
[email protected] or [email protected]

Paper link: https://arxiv.org/abs/1411.1086

Both nodes compile under catkin in hydro/indigo and use PCL1.7
17 changes: 17 additions & 0 deletions src/ira_laser_tools/cfg/laserscan_multi_merger.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python
PACKAGE = "laserscan_multi_merger"

from dynamic_reconfigure.parameter_generator_catkin import *
import math

gen = ParameterGenerator()

gen.add("angle_min", double_t, 0, "Minimum angle of the output scan", -2.36, -math.pi, math.pi)
gen.add("angle_max", double_t, 0, "Maximum angle of the output scan", 2.36, -math.pi, math.pi)
gen.add("angle_increment", double_t, 0, "Angle increment of the output scan", 0.0058, 0, math.pi)
gen.add("time_increment", double_t, 0, "Time increment of the output scan", 0.0, 0, 1)
gen.add("scan_time", double_t, 0, "Scan time of the output scan", 0.033333333, 0, 1)
gen.add("range_min", double_t, 0, "Range min of the output scan", 0.45, 0, 50)
gen.add("range_max", double_t, 0, "Range max of the output scan", 25.0, 0, 1000)

exit(gen.generate(PACKAGE, "laserscan_multi_merger", "laserscan_multi_merger"))
17 changes: 17 additions & 0 deletions src/ira_laser_tools/cfg/laserscan_virtualizer.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python
PACKAGE = "laserscan_virtualizer"

from dynamic_reconfigure.parameter_generator_catkin import *
import math

gen = ParameterGenerator()

gen.add("angle_min", double_t, 0, "Minimum angle of the output scan", -2.36, -math.pi, math.pi)
gen.add("angle_max", double_t, 0, "Maximum angle of the output scan", 2.36, -math.pi, math.pi)
gen.add("angle_increment", double_t, 0, "Angle increment of the output scan", 0.0058, 0, math.pi)
gen.add("time_increment", double_t, 0, "Time increment of the output scan", 0.0, 0, 1)
gen.add("scan_time", double_t, 0, "Scan time of the output scan", 0.033333333, 0, 1)
gen.add("range_min", double_t, 0, "Range min of the output scan", 0.45, 0, 50)
gen.add("range_max", double_t, 0, "Range max of the output scan", 25.0, 0, 50)

exit(gen.generate(PACKAGE, "laserscan_virtualizer", "laserscan_virtualizer"))
23 changes: 23 additions & 0 deletions src/ira_laser_tools/launch/laserscan_multi_merger.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!--
DESCRITPION
-->


<launch>
<!-- time delay -->

<node pkg="ira_laser_tools" name="laserscan_multi_merger" type="laserscan_multi_merger" output="screen">
<param name="destination_frame" value="base_link"/>
<param name="cloud_destination_topic" value="/merged_cloud"/>
<param name="scan_destination_topic" value="/scan"/>
<param name="laserscan_topics" value ="/laser_f/scan_filtered /laser_r/scan_filtered" /> <!-- LIST OF THE LASER SCAN TOPICS TO SUBSCRIBE -->

<param name="angle_min" value="-3.14"/>
<param name="angle_max" value="3.14"/>
<param name="angle_increment" value="0.00272707710974"/>
<!-- <param name="angle_increment" value="0.00545415421948"/> -->
<param name="scan_time" value="0.0962427780032"/>
<param name="range_min" value="0.15"/>
<param name="range_max" value="12.0"/>
</node>
</launch>
27 changes: 27 additions & 0 deletions src/ira_laser_tools/launch/laserscan_virtualizer.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--
FROM: http://wiki.ros.org/tf#static_transform_publisher
<<static_transform_publisher x y z yaw pitch roll frame_id child_frame_id period_in_ms>>
Publish a static coordinate transform to tf using an x/y/z offset and yaw/pitch/roll. The period, in milliseconds, specifies how often to send a transform. 100ms (10hz) is a good value.
== OR ==
<<static_transform_publisher x y z qx qy qz qw frame_id child_frame_id period_in_ms>>
Publish a static coordinate transform to tf using an x/y/z offset and quaternion. The period, in milliseconds, specifies how often to send a transform. 100ms (10hz) is a good value.
-->

<launch>

<!-- DEFINE HERE THE STATIC TRANFORMS, FROM BASE_FRAME (COMMON REFERENCE FRAME) TO THE VIRTUAL LASER FRAMES-->
<!-- WARNING: the virtual laser frame(s) *must* match the virtual laser name(s) listed in param: output_laser_scan -->
<node pkg="tf" type="static_transform_publisher" name="ira_static_broadcaster1" args="0 0 0 0 0.3 0 laser_frame scan1 1000" />
<node pkg="tf" type="static_transform_publisher" name="ira_static_broadcaster2" args="0 0 0 0 0.0 0 laser_frame scan2 1000" />
<node pkg="tf" type="static_transform_publisher" name="ira_static_broadcaster3" args="0 0 0 0.0 0.0 0.3 laser_frame scan3 1000" />
<node pkg="tf" type="static_transform_publisher" name="ira_static_broadcaster4" args="0 0 0 0.0 0.0 -0.3 laser_frame scan4 1000" />

<node pkg="ira_laser_tools" name="laserscan_virtualizer" type="laserscan_virtualizer" output="screen">
<param name="cloud_topic" value="/cloud_in"/> <!-- INPUT POINT CLOUD -->
<param name="base_frame" value="/laser_frame"/> <!-- REFERENCE FRAME WHICH LASER(s) ARE RELATED-->
<param name="output_laser_topic" value ="/scan" /> <!-- VIRTUAL LASER OUTPUT TOPIC, LEAVE VALUE EMPTY TO PUBLISH ON THE VIRTUAL LASER NAMES (param: output_laser_scan) -->
<param name="virtual_laser_scan" value ="scan1 scan2 scan3 scan4" /> <!-- LIST OF THE VIRTUAL LASER SCANS. YOU MUST PROVIDE THE STATIC TRANSFORMS TO TF, SEE ABOVE -->
</node>
</launch>
33 changes: 33 additions & 0 deletions src/ira_laser_tools/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0"?>
<package>
<name>ira_laser_tools</name>
<version>1.0.4</version>
<description>The ira_laser_tools package. These nodes are meant to provide some utils for lasers, like listen to different laser scan sources and merge them in a single scan or generate virtual laser scans from a pointcloud.</description>

<url>http://www.ros.org/wiki/ira_laser_tools</url>
<maintainer email="[email protected]">Augusto</maintainer>
<maintainer email="[email protected]">Pietro</maintainer>

<license>BSD</license>

<buildtool_depend>catkin</buildtool_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>libpcl-all-dev</build_depend>
<build_depend>pcl_ros</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>tf</build_depend>
<build_depend>laser_geometry</build_depend>
<build_depend>roscpp</build_depend>
<run_depend>sensor_msgs</run_depend>
<run_depend>libpcl-all-dev</run_depend>
<run_depend>pcl_ros</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>tf</run_depend>
<run_depend>laser_geometry</run_depend>
<run_depend>roscpp</run_depend>

<!-- Needed to work around https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=894656 on Debian Stretch -->
<build_depend>libvtk-qt</build_depend>
<run_depend>libvtk-qt</run_depend>

</package>
Loading

0 comments on commit 352f15a

Please sign in to comment.