That sounds OK. A more direct approach would be to write a CAN driver but I’m not qualified to do that yet. If the arduino can send mavlink then sending a DISTANCE_SENSOR message would also work because we have a “MAVLink” rangefinder driver.
Slightly more complicated and scary sounding solution but - have you tried ROS? ROS uses wrappers to make literally anything compatible with anything. All you need its (1) a computer/PC running Ubuntu of some sort - and ROS installed. Then you can USB both the ardupilot and the arduino into the PC and use ROS to load the data to your Parameter Server, or an ROS Topic, then Ardupilot can take data from anything connected to the PC and then the PC can send control commands to the robot? Just something to look into
I finally got around to setting this entire boat up. I have everything plugged in exactly as you said above, in addition to the parameters listed on the wiki. I have the boat in 0.75m column of water, and can hear the sonar pinging. The only difference I have is that I am using an Airmar DT800 sonar instead of an ECT 400 sonar. I believe the default baud rate for mine is 4800, but I have also tried 115200 and everything in between. I have also swapped the 2 and 3 pins on the serial input side.
Still the sonar range and voltage read 0. Is there something different that should be done for the airmar sonar vs the ect sonar? They both communicate over NMEA 0183.
I am using rover 3.4.0 and mission planner 1.3.56. In addition, rngfnd_type 17 does not exist on the side menu, it stops at 16. Is this an issue at all? I shouldn’t need to change rngfnd_offsets, or scaling right?
Are there any other details I could possibly give to assist? I feel I am so so so close to finally having this project complete, but just one more hurdle.
A thought: I wonder if my voltages are different using the Sparkfun Serial to TTL converter. When I had the DT 800 working with my arduino Mega, I was converting it using a Max 3232 sparkfun board. I can’t find my wiring diagram currently, but that seemed to work. When I got it working on an Uno, I didn’t need any coverter, and plugged the signal cables directly to the digital ports on the Uno, then inverted them using the Uno.
It’s definitely important that the RNGFND_TYPE is set to “17” (remember to reboot the board after changing this). Without this set, the wrong driver will be loaded and it will use the wrong protocol to try and communicate with the device. if “17” is missing then it is a ground station issue I’m afraid. If using the MP, the parameter descriptions can be updated by going to the flight data screen, pressing Ctrl F, push the “Param gen” button, wait a few minutes then restart the MP.
It’s possible that there is some other issue causing the driver not to work. Maybe if you can grab a sample of the text that the sonar is outputting I can see if our driver should consume it OK…
P.S. it’s really great that you’re giving this a try! I’m pretty sure we can get it working
Hello
I have been looking at all the questions and answers and i have some clue on what your saying but i do not fully know what some of the answers are so if I could have some help to have a better understanding what to do.
i am working in a team to build an autonomous sail boat using the Arduino and Pixhawk and other components i would like to know some more on what is the best way to do this if there is anyone out there that knows what is the best way to do it i would be thankful for it
many thanks
Could you make the connection between pixhawk and arduino? if so, could you help me with a project similar to yours, except that it is an aeromodelism plane.
hello there
I wanted to connect pixhawk with Arduino and then receive waypoint information when it reaches a particular waypoint. so that with that waypoint I can control servo at that particular waypoint