VISION_POSITION_ESTIMATE not appearing in QGroundControl

Yep… So many projecst and not enough time …
I guess that just the publisher is required as the Video could be a Gstreamer pipeline.
And the original wrapper is here : https://github.com/ethz-asl/orb_slam_2_ros

@anbello : In order to arm the copter, as I understood, you use the “ALT_HOLD” mode, and then you go back to “GUIDED”.

For now, I’m trying to do the same (with Gazebo simulation, removing all the GPS), I can arm on ALT_HOLD, but then it is impossible to change the fight mode into GUIDED.
“APM : Flight mode change failed”

And, of course, if I try to arm in GUIDED, I have the 3D fix error.

You had the same problem ? If so, how have you done it ?

When I control the copter with Joystick I arm in Loiter, when I control it with python script I arm in Guided, but I can do so only after I begin to send the vision pose estimation messages to Arducopter, so its is like if it have 3D fix.

Are you “feeding” the system with vision position message ?
Generally you should receive a ‘‘GPS GLITCH’’ message when Aruco system is kicking in, and then you have to set the ekf origin as per Andrea Python script

Thanks for your quick answers !

For now, this is how I try to manage to stabilize my drone by providing data from the ZED camera (here, I simulate the SLAM behavior with ORB SLAM, but no big change) :

I feed the topics :

  • /mavros/vision_pose/pose with the camera stereo pose
  • /mavros/setpoint_position/local with the desired state

Both are feeded in ROS, I double check it. Besides, before arming, I set home position and global position origin (which both I think works) with lat and lon of my city.

This is the setting of the drone :
drone.parm (2.2 KB)

Before arming, I use this function (inspired by mavlink python code) :

        def __init__(self, cmd, imu, state, lidar):
        ## GPS ORIGIN
        f = fifo()
        self.mav = MAV_APM.MAVLink(f, srcSystem=1, srcComponent=1)
        self.mavlink_pub = rospy.Publisher("/mavlink/to", Mavlink, queue_size = 20)

        (...)

        def set_global_origin(self):
        # Init the "GPS coordinate" but not used at all
        # SET_GPS_GLOBA_ORIGIN
        # Inspired by : https://github.com/vincekurtz/ardupilot_gazebo/blob/master/src/set_origin.py
        target_system = 0 # 0 -> broadcast to everyone
        lat = 48.866667 * 1e7
        lon = 2.333333 * 1e7
        alt = 115.0 * 1e3

        msg = MAV_APM.MAVLink_set_gps_global_origin_message(
            target_system,
            int(lat),
            int(lon),
            int(alt))

        self.send_mavlink_msg(msg, self.mav, self.mavlink_pub)

    def set_home_position(self):
        """
        Send a mavlink SET_HOME_POSITION message, which should allow
        us to use local position information without a GPS
        """
        target_system = 0  # broadcast to everyone
        lat =48.866667* 1e7
        lon =2.333333 * 1e7
        alt = 115.0 * 1e3

        x = 0
        y = 0
        z = 0
        q = [1, 0, 0, 0]  # w x y z

        approach_x = 0
        approach_y = 0
        approach_z = 1

        msg = MAV_APM.MAVLink_set_home_position_message(
            target_system,
            int(lat),
            int(lon),
            int(alt),
            x,
            y,
            z,
            q,
            approach_x,
            approach_y,
            approach_z)

        self.send_mavlink_msg(msg, self.mav, self.mavlink_pub)

    def send_mavlink_msg(self, msg, mav, pub):
        msg.pack(mav)
        rosmsg = convert_to_rosmsg(msg)
        pub.publish(rosmsg)

Can you check with QGC that you have signal on analyse widget as showned here:

Ok I will install it on Ubuntu and I let you know
I wasn’t aware that we can use QGC through ROS (Gazebo)

Somehow it is sending pose message to MAvlink and it is processed by SITL that is basically the engine for the simulation. So QGC is reading the MavLink messages.

Yes, I succeed to install it. I changed the apm.launch for it, and now it works !
That’s great !

Ok, I supposed I have missed something, because I don’t see any “VISION_POSITION_ESTIMATE” in the QGroundControl widget

Are you running everything from the same system i.e. 127.0.0.1 ?
Make sure you are reading from the correct udp ports, it sometimes tricky

I have check every single data, in the Analyze window. Datas are actualized (like attitude for example), so I suppose that the connection is ok…

Is it something really new ? I will check the firmware I use, maybe I’m not fully up to date.

I uploaded a picture of the lab I made a few month ago with SITL on Vision Room, I gues you could join us there as it is easier to work-debug https://gitter.im/ArduPilot/VisionProjects

1 Like

Thank you, I’m happy to join the community !

I have checked apm_pluginlists.yaml, and I have “vision_speed_estimate” in the blacklist. Do we need this one to work with vision for ArduCopter ?
I suppose there is a parameter that I have to set to “activate” this VISION_POSITIOn_ESTIMATE.

(It’s time for the week end, see you soon ! And thank you for your help !)

Hi again,

To summarize my situation :

  • ArduCopter firmware v3.5.7. : I think we need the v3.6.x for visual positionning. I will try with it. Do you confirm ?
  • Config of Copter just upper in the comments (GPS in desactivated, and using EKF2 for Pose)
  • Mode GUIDED

For mavros configuration :

  • apm_pluginlists.yaml => ‘local_position’ is in the whitelist
  • apm.launch=> fcu_protocol is using v2.0

For QGC :

  • The connection is working well
  • GPS_GLOBAL_ORIGIN is set (check in QGC)
  • HOME_POSITION is set (check in QGC)
  • VISION_POSE_ESTIMATE does not appear

Mavros topics :

  • I publish in /mavros/vision_pose/pose and /mavros/setpoint_position/local
  • /mavros/local_position/pose is empty (even if mavros is a listener and a publisher of the topic)

So, in order to publish PoseStamped msg data from Stereo Camera into ArduCopter and stabilize with it, am I missing something that is not on the list ?
Do I have to change some code of Mavros (like they did in the first part of this discussion, with the change of /mavros/mavros_extras/src/plugins/vision_pose_estimate.cpp ?)

If you need any file, do not hesitate and I will provide it.

Hello, Yes you need latest release

Ok, I have the famous “GPS Glitch” appearing. And the topic /mavros/local_position/pose is publishing the pose state. :sunny:
And I’m able to arm it ! :smile:

But still, I don’t have the “VISION_POSITION_ESTIMATE” in the GCS. I will try to figure out why !
Many thanks !

I am able to get the signal when feeding the mavros on same udp port without proxy, so this is a special case of spoofing, but it works for tests

I was never been able to see the messages coming via mavros on GCS as in this picture from wiki page on ros-cartographer-slam. Even if I can see all the right messages using rostopic echo /mavros/topicname. Maybe to have this working we got to use mavlink-router.

1 Like

Hi guys !

For the VISION_POSITION_ESTIMATE, I don’t see it, but nevermind, because I see the LOCAL_POSITION_NED and the GLOBAL_POSITION_INT working well.
Besides, the HOME_POSITION and the GPS_GLOBAL_ORIGIN is set.

But I don’t know how to set the target position.
I have published in the :

  • /mavros/setpoint_raw/target_local (PositionTarget)
  • /mavros/setpoint_position/local (PositionStamped)
  • /mavros/setpoint_raw/local (PositionTarget)

with the corresponding msg, mask etc. but there is no action. The drone is armed, but there is no throttle for ex.
Can I know in which topic do you publish for setting the pose desired ?

If you look at @anbello wiki Indoor autonomous flight with ArduCopter, ROS and Aruco Boards Detection — Dev documentation

You can read:

The last step (for now) is to test an all autonomous flight using one of the script included, to do this open another term or tab

ssh ubuntu@ubiquityrobot
(login)
ubuntu@ubiquityrobot:~/catkin_ws$ rosrun aruco_gridboard mavros_control1.py

1 Like