Open cmarley3-14 opened 5 years ago
we are not using Ultrasonics in lifterheight
Wait... so what's the lifter height sensor and counter for? What is it doing?
We need to test the laser distance sensor for measuring the lifter height.
The laser sensors arrived and were sitting on the workbench. I moved them into the "programming" bag hanging on the wall. They're in blue bubble wrap. They need to be wired up and code written to read the values (hopefully, there's a library for them already).
This is the source code: https://github.com/GirlsOfSteelRobotics/Docs/wiki/LIDAR-Lite-Distance-Sensor
The pdf of the roborio with specificatinos for wiring and in/out put stuffs. http://www.ni.com/pdf/manuals/374474a.pdf
We should be wiring according to the left side. If it doesn't work, switch to the right side.
Reading the comments will help decode the code. It may be relevant and helpful. Especially with working with pinouts and how to get data. Otherwise, just refer back to Ryan's code. https://github.com/garmin/LIDARLite_Arduino_Library/blob/master/examples/v3/GetDistancePwm/GetDistancePwm.ino
Has pinout charts (determine which is relevant) and a (possibly relevant) picture at the bootom of webpage. https://docs.px4.io/en/sensor/lidar_lite.html
Code now reads in inches within an inch currently calibrating values but it works
Wiring information on LIDAR:
Wire Color | Function |
---|---|
Red | 5Vdc (+) |
Orange | Power enable (internal pull-up) |
Yellow | Mode control |
Green | I2C SCL |
Blue | I2C SDA |
Black | Ground (-) |
(from http://static.garmin.com/pumac/LIDAR_Lite_v3_Operation_Manual_and_Technical_Specifications.pdf)
Wiring info (from https://github.com/GirlsOfSteelRobotics/Docs/wiki/LIDAR-Lite-Distance-Sensor):
roboRIO
DIO Port LIDAR-Lite
-------- --------
Power __________________________ +5V Power
Signal __________________________ Mode Select
| 1KOhm
|_/\/\/\_
Ground _________________|________ Ground
Other wires are not used.
moved to wiki
The work item here is getting the LIDAR to work and that is not complete.
https://github.com/garykac/amhs-robotics-4681/blob/4210af8eab9108ee03218ffa341b8927d5250e9b/workspace/2019%20DeepSpace/src/main/java/frc/robot/LifterHight.java#L18-L52
The concerns that have been brought up include:
minMaxOffset
andcounter.getPeriod() * x / x
mean?getDistance()
return?BTW,
kDIOLifterHeightSensor = 2
.