Python code to use a Robotis servo to tilt a Hokuyo to get 3D point clouds.
- Author: Advait Jain, Advisor: Prof. Charlie Kemp, Lab: Healthcare Robotics Lab at Georgia Tech
- License: New BSD
- Source: git https://code.google.com/p/gt-ros-pkg.hrl/
Making the Rig
Servo part number, CAD models for mounting adaptors, instructions for constructing the rig can be found here:
Getting a Point Cloud
Before using this code to obtain point clouds, you need to:
- have made a rig consisting of a Hokuyo mounted on a Robotis servo.
be able use robotis to operate a Robotis servo.
be able to use hrl_hokuyo to get scans from a Hokuyo.
Once you have the rig set up:
roscd hrl_hokuyo; roslaunch acm0_utm.launch
python tilt_hokuyo_servo.py -h
- Run it with appropriate parameters. For example:
python tilt_hokuyo_servo.py -d /dev/ttyUSB0 -n0 --save_scan --speed=10 --id=<servo id> --l2=0.035
- You should see the servo tilt the UTM between the two angles that you specified.
Once the code runs, it will save the scans in a pkl. (e.g. 2009Oct05_203107_dict.pkl)
To view the point cloud, use display_3d_mayavi.py (python display_3d_mayavi.py -h)
Using the Code
Brief description of the different files in this package:
tilt_hokuyo_servo.py - defines the class to obtain point clouds.
display_3d_mayavi.py - Uses mayavi2 to display point clouds.
processing_3d.py - some functions for working with point clouds. Includes segmenting doors, door handles, horizontal surfaces (tabletops, countertops etc.), objects on a horizontal surface etc.
occupancy_grid_3d.py - 3D occupancy grid implementation in python.
Can you get scans from a Hokuyo using hrl_hokuyo?
Can you use robotis to operate a servo?
- Walls are not vertical or walls and the ceiling do not seem to be at right angles in the point cloud:
look at the file servo_transforms.jpg
Ensure that l1 and l2 that you are specifying when you run tilt_hokuyo_servo.py are correct.
Note: l2 can be negative depending on how the UTM is mounted.