I dont use cmavnode, so I cannot comment on this part.
My preferred tool for debugging are QGroundControl Widgets : Analyse & Mavlink Inspector as showned on the picture above, you will be able to confirm the operation and values of Distance Sensor.
@ppoirier, heartbeat messages were not necessary. I noticed that POC is using system_mode parameter with value zero. It seems that this value is invalid, since it is not in MAV_MODE_FLAG ENUM.
I’m sending distance_sensor messages for orientations 0-7, 24, and 25.
Now I’ll test if ArduCopter really uses these messages to avoid obstacles.
Updating the wiki is something you could certainly do, it is quite easy, and its helping everyone
Concerning the heartbeat, you are right, I used the feature as a standalone when working directly with the widget. The value “0” returns a Uninitialized system, state is unknown, that has no real incidence for this component, but thanks for pointing it.
nice, thats really cool. Could you share your arduino code? Most importantly the part where it sends the mavlink message. Are there any resources / libraries involved? Could you give me a hint, where to look for those?
okay, thank you! but where is the heartbeat sending the distance measurement?
do you have any idea how to permanently change the i2c address of the lidar lite v3? I want to use 2 of them via i2c.
thank you
Which message pack should I use to send the distance messages?
I’m guessing I need something that looks like the pack function for the heartbeat (mavlink_msg_heartbeat_pack(sysid,compid, &msg, system_type, autopilot_type, system_mode, custom_mode, system_state))
But I’m not sure which pack to use. Also, if you know where to find a list of the pack functions, that would be great.
Thanks for the reply and link to your code! I really appreciate it.
I’m using SharpIR sensors, which are sampled at a baud rate of 9600. Do I have to feed the Pixhawk serial port (using Telem1) at 115200 like what your code is doing? or can I simply adjust the serial baud rate in pixhawk parameters to 9600? As you know, switching baud rate on a non-mega arduino is a bit tricky.
Patrick, I have a LIDARLite v3 working as a horizontal proximity sensor (Mission Planner 1.3.52.0; Copter 3.5.4). The copter slides (annoyingly) to port side when the AVOID_MARGIN 2m is reached. From the info in your post I gather that I can set PROXIMITY_SENSOR 2 to cause a STOP. You mention that this can be configured using advanced options within Mission Planner. I’ve scoured MP Full Parameter List but can’t find any reference to this setting. Can you please advise further how to define AC_AVOID_USE_PROXIMITY_SENSOR value?
Thanks for your time.