( I actually have two quads. This one is based on the pixhawk 2.4.8 and I am
starting with this one as this is my “try-it-first-drone”. But ultimately I want
to transfer it to my other quad based on the Pixhack V3x )
On the 2.4.8 I am running copter 3.55 and on the pixhack V3 I am runing 4.06.
I have coded the sensor-interface code and I can also receive the heartbeat messages from the 2.4.8.
Port 2 on Teensy : connected to drone ( Mavlink )
Port 3 on Teensy : connected to TFmini+
I have checked the contents of the message been sent to the drone and it seems correct. BUt my MP still says : Bad LiDAR health. Which to me means it is not receiving the messages I am sending.
Oh… my settings are
RNGFND_ORIENT 0
RNGFND_TYPE 10
PRX_TYPE 4
Now my question:
From what I have been reading , certain commands ( like Param request ) will result in a response.
Does the mavlink message MAVLINK DISTANCE MESSAGE also yield a response that I can look out for ? If so, then I can use the response or lack thereof, to judge if the FC is receiving my message ?
I couldn’t find a place where MP can show me the mavlink messages, hoping I can use that to see if the FC is receiving my message.
On Missionplanner “FLight Data” screen , press CTR-F
additional window pops up
Click on “Mavlink Ins” towards the middle of the screen
and it shows the screen that I have attached.
There is shows my distance sensor I #158 and if I hold my hand
in front of the sensor then the reading changes.
So this proves that my sensor data is being received by the FC.
Currently I have -
Single sensor via Teensy 4.0 reporting to Pixhawk 2.4.8 and showing up on prox-radar.
I then played around with various options , UART-I2C and for that I moved to Arduino Mega simply because I know it better than the Teensy.
The setup currently is - 3 TFMini+ sensors connected to Arduino Mega and successfully reading 3 sensors. Currently the Mavlink to drone FC is disabled. Sensors reporting data at 50 Hz ( 50 readings
per second ). Baud rate 115200.
I am now playing around with some calculations - sensor-rate and mavlink-stream-rate vs acceptable speed of the drone. If I get data from the sensors at 50Hz, then there will be a dead-distance for the drone of 27cm at 50km/h.
The big question in my mind - what would be the best stream-rate to the FC of the drone of the collected sensor-data? Surely I cant just increase the stream-rate to the FC at will ??
I shall have 20Hz as a target then.
I think my strategy will be to keep my data-rate at 50Hz while disconnected from the FC while I port
the code to the Teensy 4.0. If the Teensy doesn’t fall over with all these sensors at 50Hz then 20 Hz is
going to be a breeze.
At least I have enough time at hand - since we are all in Covid-lockdown here !!!