Closed antonio-sc66 closed 3 years ago
@TSC21 Do you have an example that you could point people to?
I don't but @Jaeyoung-Lim might have some insights since he extended the setpoint_position plugin with support for sending SET_POSITION_TARGET_GLOBAL_INT messages. But the quickest thing I can think of is that the altitude being sent is the relative instead of the absolute. The plugin by default expects the absolute.
@antonio-sc66 Could you try out https://github.com/PX4/PX4-Autopilot/pull/16514 ? This should fix your problem
Hi, @Jaeyoung-Lim, I will try the fix this weekend
@antonio-sc66 Any updates?
Describe the bug When trying to send setpoints with MAVROS using the
setpoint_position/global
topic with the _geographicmsgs GeoPoseStamped message to send SET_POSITION_TARGET_GLOBAL_INT msgs, the drone tries to reach the indicated latitude and longitude but the altitude isn't working as expected. I still haven't tried to send the Mavlink msgs directly but the MAVROS ones seem well formed (https://github.com/mavlink/mavros/blob/master/mavros/src/plugins/setpoint_position.cpp#L189 and https://github.com/mavlink/mavros/blob/master/mavros/include/mavros/setpoint_mixin.h#L80).In case you're trying to keep the same altitude and copy the global altitude to the setpoint global altitude the drone skyrockets. If you set altitudes using relative measurements in AGL then the drone starts to descend and ends up either landing or crashing. (MAVROS sets the reference frame to MAV_FRAME_GLOBAL_INT).
During the procedure the PX4 SITL terminal throws the next warnings:
I've prepared a small Python script that sends setpoints with the current position (drone should stay still) or sends setpoints to the HomePosition location so that it can be easily tested.
I would like to know if I'm doing anything wrong or if this is indeed a bug as local setpoints are working as expected.
To Reproduce Steps to reproduce the behavior:
Expected behavior The drone should move to the desired latitude and longitude and maintain the indicated altitude
Drone (please complete the following information): PX4 SITL Iris Quadcopter
Additional context Tested using master branch (a88b7fc517bff7f236ca4881aaa7abda89a32260) Ubuntu 18.04 with ros-melodic and ros-melodic-mavros pkgs
Python script example to perform the test