Recent Changes - Search:

2010

Project X 2010

MCP III.5 2009

2008 Docs

Old Docs

2007 Docs

Who And What

edit SideBar

LRF

Laser Range Finder (LRF)

  • Laser Range Finder is used to help the robot avoid hitting barriers.
  • Our robot uses "SICK LMS200" LRF
    • The Laser Rangefinder is connected to serial port 1 on the robot's P4 computer (visionmcp).
    • After login, start "player" with the laser config file. Run command: "player laser.cfg &"
    The player reads the LRF data, and makes them available via network.
    • The config file contains hardware type, resolution information.
      driver
      (
        name "sicklms200"
        provides ["laser:0"]
        port "/dev/ttyS1" #serial port 1
        resolution 50   # angle resolution 0.5 degree
        range_res 1      # Range resolution 1 mm (maximumrange 8.192m)
      )
      
    • Bring up the player client -- "playerv", which read the data from network, and display it graphically. Run command: "playerv &"
    • From the "playerv" menu, subcribe to laser, you will see the range information in a picture.
  • Sample pictures:
    • Photo 1: a chair on the left side.
    • Photo 2: Moved the chair to the right side and closer to the LRF.
  • Player client code to read laser input:
#include <iostream>
#include <libplayerc++/playerc++.h>

/*
 g++ -o try_laser `pkg-config --cflags playerc++` try_laser.cpp `pkg-config --libs playerc++`

*/

int
main(int argc, char *argv[])
 {
  using namespace PlayerCc;
  double r1, r2, r3;

  PlayerClient    robot("localhost");
 //  SonarProxy      sp(&robot,0);
 //  Position2dProxy pp(&robot,0);
  LaserProxy lsp(&robot,0);

  for(;;)
  {
    // read from the proxies
    robot.Read();
    r1 = lsp.GetRange(100);
    r2 = lsp.GetRange(200);
    r3 = lsp.GetRange(300);
    // print out data
    std::cout << r1 << " " << r2 << " " << r3 << std::endl;
  }
 }
Edit - History - Print - Recent Changes - Search
Page last modified on April 11, 2007, at 01:08 AM