Last modified 7 years ago Last modified on 29/01/14 00:24:37

Generate Laser Data from Map and Position

This plugin takes an occupancy grid map and a position as input and generates data "as a laser sensor would perceive it" at the given position in the given map.

The plugin serves two different purposes.

  1. to generate input data for testing self-localization plugins such as amcl
  2. to generate laser data as input for components like navigation and collision avoidance based on the static obstacles in the map


Since the plugin uses features of the amcl plugin regarding map procesing, its configuration typically resides in the amcl.yaml config file. For the first use case it also uses some of the values directly from the amcl plugin. In particular the map parameters are the same.

/plugins/amcl/map-lasergen/use_current_posboolFalse to use statically configured position (use case 1), True to use current self-localization result (use case 2)false
/plugins/amcl/map-lasergen/pos_xfloatX coordinate of static position (use case 1 only)
/plugins/amcl/map-lasergen/pos_yfloatY coordinate of static position (use case 1 only)
/plugins/amcl/map-lasergen/pos_thetafloatOrientation (rad) of static position (use case 1 only)
/plugins/amcl/map-lasergen/add_gaussian_noiseboolTrue to add gaussian noise to the generated data.true
/plugins/amcl/map-lasergen/noise_sigmafloatSigma for gaussian noise generation0.2
/plugins/amcl/map-lasergen/send_zero_odomboolTrue to publish the odometry coordinate frame with zero movementtrue
/plugins/amcl/map-lasergen/laser_interface_idstringInterface ID for output dataMap Laser
/plugins/amcl/map-lasergen/pose_interface_idstringInterface ID of input pose (use case 2 only)Pose
/plugins/amcl/odom_frame_idstringCoordinate frame ID for odometry (only if send_zero_odom is true)
/plugins/amcl/base_frame_idstringCoordinate frame ID for odometry (only if send_zero_odom is true) and to estimate the laser pose
/plugins/amcl/laser_frame_idstringOutput frame for generated data

For use case 1 it is recommended to set

use_current_pos: false
add_gaussian_noise: true
send_zero_odom: true

For use case 2 the following settings are more appropriate:

use_current_pos: true
add_gaussian_noise: false
send_zero_odom: false

BlackBoard Interfaces

  • Laser360Interface::ID: Laser360Interface instance for the output data
  • Position3DInterface::ID: Position information for use case 2.

Compilation and Runtime Requirements

  • Optional: LaserGUI for visualiuzation (if enabled in configuration)

Usage Instructions

Configure the plugin as explained above. Run the plugin and use e.g. the LaserGUI? or rviz to view the laser data.