I want to pass VISION_POSITION_ESTIMATE message to the ardupilot that sits in the VM. The sim-vehicle is arducopter. And I am not using ros. The connection seems fine too, heartbeat is received in the script.
Parameter that i have changed
AHRS_EKF_TYPE = 3
EK3_ENABLE = 1
GPS_TYPE = 0
EK3_SRC1_POSXY = 6
EK3_SRC1_POSZ = 6
EK3_SRC1_YAW = 6
Is there any other thing that could prevent mission planner showing mavlink messages? Or any extra parameter that i need to change, so i could receive the messages? The goal achieving indoor hovering with the data from the vision camera. what are the ways to debug or solve this matter?
Either your vision camera isn’t sending the MAVLink messages or the messages aren’t being routed to Mission Planner. Note that ArduPilot won’t always re-broadcast incoming MAVLink messages.
How are you connecting the vision camera, ArduPilot and Mission Planner together?
Is there a way to check whether Ardupilot getting the message or not? My vision camera is connected to the VM, using a python script to pass data (mavlink message, which does not show in the inspector) to ardupilot, both live in the same ip. Mission planner is in the host pc, with a different ip address. I use mavproxy to forward udp package to mission planner.
Inside the camera script
master = mavutil.mavlink_connection(‘udp:127.0.0.1:14550’)
master.wait_heartbeat()
…
def send_vision_position_estimate(mavlink_connection, usec, x, y, z, roll, pitch, yaw):
mavlink_connection.mav.vision_position_estimate_send(
usec,
x, y, z,
roll, pitch, yaw
)
…
send_vision_position_estimate(master, usec, x, y, z, roll, pitch, yaw) #all data is processed from the image captured by the camera
Assuming your vehicle is correctly configured for receiving visual odometry messages:
If your pre-arm checks are active, you’ll get a PreArm: VisOdom: not healthy status message if ArduPilot is not receiving any visual odometry messages.
Additionally, when ArduPilot first receives the visual odometry messages you’ll see the EKF initialisation messages:
EKF3 IMU0 is using external nav data
EKF3 IMU0 initial pos NED = -0.0,-0.0,-0.0 (m)
EKF3 IMU0 initial vel NED = -0.0,-0.1,-0.0 (m/s)
I connected the host gcs when I start up sim_vehicle, instead of using mavproxy forward.
sim_vehicle.py -A “–serial0=udpclient:14550” --console --map
I managed to inspect the VISION_POSITION_ESTIMATE message now.
It does say PreArm: VisOdom: not healthy message, but i also see
EKF3 IMU0 is using external nav data
EKF3 IMU0 initial pos NED = -0.0,-0.0,-0.0 (m) message. I believe that is because i turn off the velocity data source. I did not have a specific sensor for velocity. Is it required to send data to velocity parameter? Can I just set EK3_SRC_VEL to 0?
However, the message is broadcasted instead of going to vehicle1 component1. The code above remains the same. I tried defining the target system and target component of the message, but the message stays at vehicle 255 comp 0. When I inspect the altitude and yaw data, it does not seem to follow the visual data and fluctuate. Because of the fluctuation, it makes me think there is some other data source that ek3 is referencing.
You do require a velocity sensor for the EKF3 to work properly. You can choose from are GPS, visual odometry, wheel encoders or beacons (Complete Parameter List — Copter documentation).
I’d recommend modifying your vision system to output the VISION_SPEED_ESTIMATE message.
The VISION_POSITION_ESTIMATE is a broadcast message. The majority of MAVLink messages are. The 255/0 you’re seeing is the source sysid/comid, not the target.
Got it! I now published the VISION_SPEED_ESTIMATE message.
I am using arduplane for simulation, not arducopter, sorry for the confusion, with q enable.
I am trying to set EKF origin for the ardupilot. However, after I clicked set EKF origin. On a spot, the plane logo did not show up. I tried it with arducopter, the copter logo show up and i was able to get some response/status change(yaw and altitude), although the yaw change relatively slow and altitude is off. On the arduplane side, the plane logo did not show up and the ekf was also having problem to start.
PreArm: AHRS: EKF3 not started
PreArm: AHRS: waiting for home
PreArm: VisOdom: not healthy
Also, I am a bit confused with the parameter VISO_ORIENT, how does ardupilot treat the position data base of the parameter VISO_ORIENT? My camera is pointing downward, and let’s say 20cm above the tag, I am forwarding z = 0.2 to the ardupilot. Does it make sense?
I am trying to setup a quadplane with a vision system like in your case. Were you able to set it up after all? Could it be that this can not be done in Plane but only in Copter?