FRC1076 / 2019-Competition

Code for 2019 Competition
2 stars 1 forks source link

Write navx code so that it can act as sensor for ElevatorAttendant #78

Closed mcolinj closed 5 years ago

mcolinj commented 5 years ago

Need navx to act as a positional sensor to predict elevator height. If it can do that (as well as help us drive straight, then things might be simpler.

Need this for debug and evaluation on Friday night.

The navs is mounted flat on the floor of the intake handler, so we are interested in changes in the Z direction. If we don't have any way to determine if the elevator is all the way down (to reset to 0), we can provide a manual reset button for this test. (much like was used in the original Turner implementation).

mcolinj commented 5 years ago

https://github.com/robotpy/examples/blob/master/navx/robot.py

probably using an incantation like this to create the reference to the navx:

self.navx = navx.AHRS.create_usb()

Note the example code checks to see if the navx support displacement measurement. I believe we do, but we ought to check the code with the same check. We need to use the functions that can reset the Z displacement and read from it. This let's us measure how much the elevator has moved.

I think we'll want to debug this with the robot, but I think it might be possible to talk to the navx from the simulator (over a USB connection), so it might be possible to check out some things. You'll need to look to see if that is possible.

mcolinj commented 5 years ago

cannot really do this due to cable length limitations. Cheap sonar will work better, we think.