Rov moves to target position

Hi, I’m doing a function in the rov of firmware ardusb==4.5.3, moving to a target latitude and longitude. My robot uses UGPS from waterlinker company, and the location information has been correctly passed into ardusub through the UGPS plug-in. I imported standard bluerov2 parameters and changed GPS_TYPE to MAV. When I use ALT_HOLD mode, I can use set_attitude_target and set_position_target_global_int to adjust the depth normally. However, when I switch to GUIDED mode to use set_position_target_global_int_send, my robot will move irregularly and it will not move to or even be away from the target point. After uploading MISSION in the QGC interface, the robot also moves irregularly. What is this problem? I want to use this function, do I need to configure some additional parameters?
Below is my code::

        type_mask = (  # ignore everything except z position
            #  mavutil.mavlink.POSITION_TARGET_TYPEMASK_X_IGNORE |
            #  mavutil.mavlink.POSITION_TARGET_TYPEMASK_Y_IGNORE |
            #  mavutil.mavlink.POSITION_TARGET_TYPEMASK_Z_IGNORE |
                mavutil.mavlink.POSITION_TARGET_TYPEMASK_VX_IGNORE |
                mavutil.mavlink.POSITION_TARGET_TYPEMASK_VY_IGNORE |
                mavutil.mavlink.POSITION_TARGET_TYPEMASK_VZ_IGNORE |
                mavutil.mavlink.POSITION_TARGET_TYPEMASK_AX_IGNORE |
                mavutil.mavlink.POSITION_TARGET_TYPEMASK_AY_IGNORE |
                mavutil.mavlink.POSITION_TARGET_TYPEMASK_AZ_IGNORE |
                #  mavutil.mavlink.POSITION_TARGET_TYPEMASK_FORCE_SET |
                mavutil.mavlink.POSITION_TARGET_TYPEMASK_YAW_IGNORE |
                mavutil.mavlink.POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE
        )
        while time.time() < end_time:
            dis = self.haversine(lat_target, lon_target)
            if dis < 1:
                break
            self.master.mav.set_position_target_global_int_send(
                int(1e3 * (time.time() - self.boot_time)),
                self.master.target_system, self.master.target_component,
                mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT,
                type_mask,
                int(lat_target * 1e7),
                int(lon_target * 1e7),
                -0.3,  
                0, 0, 0,  
                0, 0, 0,  
                0, 0  # yaw, yaw_rate
            )
            time.sleep(0.5)

Hi @chang-M -
Have you confirmed your setup works using just the default interface, and not any custom code? You can set the position of the ROV, and navigate in Auto mode just from QGC… if that doesn’t work, you may have hardware issues - acoustic localization typically doesn’t work well in tanks…

Therefore, UGPS cannot guarantee that rov works properly in AUTO or GUIDED mode. If I want it to work properly, you need to use DVL. Is this correct?

What are your EK3_SRC1 parameters set to, and can you describe what you mean by it moves irregularly?

No positioning system can guarantee it works flawlessly - there is always some potential for noise, interference, or errors.

No. A UGPS system should generally be able to provide a stable enough position estimate for the position-enabled control modes like AUTO and GUIDED to work.

That said, as Tony mentioned, acoustic systems (like a UGPS or DVL) can struggle in very small bodies of water (due to the sound waves bouncing around between the top, bottom, and sides), so it depends on how you are testing your device, and what kind performance you require.

1 Like