wiki:Plugins/laser
Last modified 7 years ago Last modified on 03/15/11 13:44:10

Laser Range Finder Plugin

Hardware driver plugin to access data from 2D laser range finders. It currently supports the Hokuyo URG and Lase EDL.

An arbitrary number of laser input devices can be configured. For each laser, a separate acquisition thread will be started, retrieving the data concurrently to the main loop. A separate thread will be started for each acquisition thread that posts new data if available during the sensor hook. There exists one distinguished "main" laser sensors, which can be visualized using the LaserGUI?.

For the Hokuyo devices the plugin can either use the vendor's own urg library, or the Gearbox 9.11 implementation of the SCIP 2.0 protocol. It has been tested successfully for the URG-04LX-UG01 with both.

The Lase EDL driver assumes a USB CAN adapter using the Peak Systems Linux CAN driver. The communication protocol is implemented within Fawkes, no external library (besides the PCAN driver) is required. It has been tested with a customized Lase EDL L A. The compatibility to other devices by Lase is unknown. Note: The PCAN driver can be compiled in two different access modes, either in "chardev" mode (access device as a device file) or in "netdev" mode (use socket API). This plugin requires the chardev mode, but netdev mode is the default. To enable chardev mode, compile the PCAN driver with make all NET=NO_NETDEV_SUPPORT.

Requires

Config Values

The configuration values below show example configurations for the URG laser scanner (for both, the urg and Gearbox libraries) and the LaseEDL scanner. You can omit or disable a configuration if not used. Replace the <urg>, <urg_gbx>, or <lase_edl> place holders with a symbolic name. The laser interface will have this in its ID. The default configuration simply omits the arrow braces. Note that you can have only one configuration marked as main sensor.

PathTypeDescriptionDefaultR
/hardware/laser/<urg>/activeboolEnable this configuration?0
/hardware/laser/<urg>/main_sensorboolMake this the default sensor, i.e. interface ID "Laser"?1
/hardware/laser/<urg>/typestringConfiguration is for Hokuyo URG laser range finder using URG libraryurg
/hardware/laser/<urg>/devicestringDevice file/dev/ttyACM0
/hardware/laser/<urg_gbx>/activeboolEnable this configuration?0
/hardware/laser/<urg_gbx>/main_sensorboolMake this the default sensor, i.e. interface ID "Laser"?1
/hardware/laser/<urg_gbx>/typestringConfiguration is for Hokuyo URG laser range finder using the Gearbox libraryurg_gbx
/hardware/laser/<urg_gbx>/devicestringDevice file/dev/ttyACM0
/hardware/laser/<lase_edl>/activeboolEnable this configuration?0
/hardware/laser/<lase_edl>/main_sensorboolMake this the default sensor, i.e. interface ID "Laser"?1
/hardware/laser/<lase_edl>/clockwise_angleboolReverse default angle direction to clockwise?1
/hardware/laser/<lase_edl>/typestringConfiguration is for Lase EDL laser range finderlase_edl
/hardware/laser/<lase_edl>/interface_typestringInterface type, currently only usbusb
/hardware/laser/<lase_edl>/use_defaultboolUse default settings from flash?0
/hardware/laser/<lase_edl>/set_defaultboolStore default settings in flash?0
/hardware/laser/<lase_edl>/canonical_resolutionstringCanonical resolution, if set overrides rotation_freq and angle_step; one of low (1 deg, 20 Hz) or high (0.5 deg, 15 Hz)high
/hardware/laser/<lase_edl>/rotation_frequnsigned intMaximum rotation frequency; Hz20
/hardware/laser/<lase_edl>/angle_stepunsigned intAngle step; 1/16th degree16
/hardware/laser/<lase_edl>/max_pulse_frequnsigned intMax pulse frequency; Hz10800
/hardware/laser/<lase_edl>/profile_formatunsigned intProfile format, 0x0100 only distances, 0x0400 only echoes, 0x0500 both256
/hardware/laser/<lase_edl>/can_idunsigned intCAN ID of laser683
/hardware/laser/<lase_edl>/can_id_respunsigned intCAN ID response1808
/hardware/laser/<lase_edl>/sensor_idunsigned intSensor ID in laser16
/hardware/laser/<lase_edl>/sensor_id_respunsigned intSensor ID response3
/hardware/laser/<lase_edl>/btr0btr1unsigned intBaud rate key, 0x14 for 1 MBit/s20
/hardware/laser/<lase_edl>/portunsigned intPort, 0 for default0
/hardware/laser/<lase_edl>/irqunsigned intIRQ, 0 for default0
/hardware/laser/<lase_edl>/num_init_triesunsigned intNumber of times to try initialization5
/hardware/laser/<lase_edl>/mount_rotationfloatRotation of the laser towards front; degree180
/hardware/laser/<lase_edl>/use_dead_spots_filterboolIf true, the fflaser_calibrate tool must be used to gain information about dead spots, which are then extracted with a filter0

Provides

BlackBoard Interfaces

  • Laser360Interface::Laser: Provided if a main sensor has been defined.
  • Laser720Interface::Laser: Provided if a main sensor has been defined and this sensor supports high resolution scans (Lase EDL).
  • Laser360Interface::Laser <ID>: Provided for laser range finders which are not the main sensors. <ID> is replaced by the configuration name.
  • Laser360Interface::Laser <ID>: Provided for laser range finders which are not the main sensors and which support high resolution scans (Lase EDL). <ID> is replaced by the configuration name.

Compilation and Runtime Requirements

  • URG library (urg and urg-devel on Fedora)
  • Gearbox library (gearbox and gearbox-devel on Fedora)
  • Peak Systems PCAN library

These libraries are all optional. If none is available, the plugin will not be built, as no hardware drivers would be available.

Usage Instructions

Connect the laser range finders you wish to use to your robot. Then create or adapt the configurations matching your setup. In most cases, enabling one of the default entries should suffice. For example, to use a Hokuyo URG using the urg library run Fawkes, configure it, and run the plugin like this:

fawkes
ffconfig set /hardware/laser/urg/active true
ffconfig set /hardware/laser/urg/main_sensor true bool
ffplugin -l laser

You should see the parameters of the Hokuyo scanner in the Fawkes log. Make sure that the Fawkes process has access to the device file, for example using sudo chmod 666 /dev/ttyACM0 for the first connected scanner.

Afterwards, you can run the LaserGUI? to view the laser data in real-time as it is written to the blackboard.