If you have not already done so, please go through the PhantomX Hexapod Getting Started Guide .Also, go through the LIDAR Lite getting started guide to hook up and test your LIDAR Lite. NOTE: You should leave your servos wired as you did in the Hexapod setup guide.
|LIDAR Lite Pin||ArbotiX Pin|
|5v||D16 Power Pin|
|GND||D16 Ground Pin|
|SDA||D16 Data Pin|
|SCL||D17 Data Pin|
Download the firmware and software zip file. Extract this file's contents to your computer.
in your Arduino IDE and load it onto your ArbotiX-M. Your hexapod will stand up and begin its program. If an object is less than 90cm away, the hexapod will move away from the object. If an object is more than 110cm away, it will move towards the object. Between 90cm and 110 cm, the hexapod will stand still. You can adjust the value that the hexapod tries to maintain away from an object (GOAL) and the deadband around the goal (DEADBAND) in lines 26/27 of the code
#define DEADBAND 10 #define GOAL 100
The LIDAR Lite has a vary narrow beam, so you may need to use a box or other object to make the hexapod move - if the LIDAR lite senses distance between your feet, the hexapod may still try to approach you.
Possible improvements to this demo could be
- Turning the hexapod body to scan a larger area
- Mounting a panning servo to scan a larger area
- Using more sophisticated position error correction (Like PID) to create smoother start/stops of the hexapod.