Sorry this is such a long post, but it there’s a lot of context for these questions, so I’m just trying to get all of the relevant info out from the beginning. I’m a student at MIT working on a research plane for testing cutting edge ultra-short takeoff techniques. One of the key data points that we need for our analysis is motor RPM.
Of course most available brushless motor RPM sensors are not Pixhawk compatible, at least in the quantity that we need, and that doesn’t address our other sensors that we would like to integrate.
High Level Plan
- Two Arduinos read RPM and thermocouple data coming from outboard sensors
- Each Arduino connects to a Pixhawk as an I2C slave
- Pixhawk reads each Arduino at some x > 1 Hz
- Pixhawk logs and also transmits this data via MAVLINK
Already Done Stuff
- Arduino reading sensors and writing to I2C
I2C::read(), afaik (as far as I know)
I2C::probe(), currently unused
- Config variable that has values
- 0 for disabled
- 1 for a single Arduino at some
- 2 for a single Arduino at some
- 3 for two Arduinos at both of the above addresses
- CMakeLists.txt similar to the
- Am I correct that messages sent to the
DEBUG_VALUEtopic will get forwarded on to QGroundControl via Mavlink?
- How do I keep track of which driver instance is talking to which Arduino? Do I make a single class that runs both and just use switches everywhere?
- Do I need to do anything beyond an empty definition for
probe()under the assumption that the Arduinos are working properly?
init()likely only needs to call the I2C constructor and set default values for any internal state I want?
- Why do the other I2C drivers use ring buffers to store the messages published to uORB?
- Are there other big “gotchas” that I should be aware of to get this driver working asap?
If you want to just take a look at the code itself, I’ve get a fork of PX4 at:
My stuff is in
src/drivers/arduino. Excuse the general sad state of my C++.