i need to control vehicle in “manual” manner. I dont know how it’s named correctly, may be semi-automatic may be somehow differrently. What i mean. I need to programmatically control such vehicle’s parameters as yaw, roll, pitch, airspeed, vertical speed and others. How can i achieve this?
I tried to send MANUAL_SETPOINT with freq > 2Hz and set flight mode to Offboard - px4 declines set mode command. Also i tried to send SET_POSITION_TARGET_GLOBAL_INT commands, but without any success - seems like vehicle ignores them.
Tell me please what i do wrong and how to do right?
You’re able to select the type of setpoints with the type_mask in that mavlink message. The only real requirement for update frequency is preventing the offboard failsafe from triggering. Beyond that it depends specifically what you’re trying to do.
Could you tell me if mavlink message MANUAL_CONTROL is possible to use in this case? (https://pixhawk.ethz.ch/mavlink/#MANUAL_CONTROL) Is there any possibility of using it to control yaw/roll/pitch programmatically? I’m asking becouse maybe I have similar problem, wondering how to control position of multirotor without any GPS and magnetometer, strictly reacting on different sensors signals.
Thank You for your response!
But is it possible to use SET_POSITION_TARGET_LOCAL_NED without knowing the orientation according to Geographical directions? In my application, drone will fly indoor in spaces where we can’t trust magnetometer and without GPS. In flying with camera, virtual north can be estimated and kept by computer vision algorithms. I want to use only a few sonars installed horizontaly in order to avoid crashes with close walls, so I won’t know where any direction is. Maybe I would be able to take in my navigation, that North is always in front of the drone ? Do you think that I will be able to use SET_POSITION_TARGET_LOCAL_NED ?
excuse me, but i don’t understand how to achieve my goal(
I tried to add flag MAV_MODE_FLAG_HIL_ENABLED to mode bitmask as you said. After sending MAV_CMD_DO_SET_MODE command with 1st parameter = MAV_MODE_FLAG_HIL_ENABLED | MAV_MODE_GUIDED_ARMED and BM and CM corresponding to “Offboard”, flight mode changes to “Position”, not “Offboard”. And vehicle still hasn’t any reaction on SET_POSITION_TARGET_LOCAL_NED messages.
could you please provide a step-by-step instructions for switching vehicle to offboard mode if it possible?
btw, it seems that firmware in master branch have bugs when works in hil mode - coordinates changes as Flash from DC comics, relative altitude sometimes is negative, although i’m flying above more or less smooth landscape.
upd now i’m able to switch to Offboard mode using deprecated SET_MODE command. But after doing that HIL is being disabled. How to switch to Offboard with preserving HIL using MAV_DO_SET_MODE command?
I’m trying to use offboard mode from dronekit with fixedwing…I couldn’t achieve takeoff via offboard mode trying all the different typemasks for position and velocity but no luck. I’ve taken off in mission mode and then successfully switched to offboard mode but with type masks than only enable position and velocity (tried both) and the plane with just lock altitude and heading…with the type mask that enables everything, the plane just circles and climbs nonstop.
I’m using the master branch from the github that I cloned 1-2 weeks ago. I followed this post: OFFBOARD takeoff, land, loiter via SET_POSITION_TARGET_LOCAL_NED, along with looking at the mavlink_receiver.cpp code and tried all the typemasks. Even with the 0b0000000000000000 wide open typemask with zeros for all the values, the plane still circles and climbs. Every other type mask fails to takeoff and if I takeoff first with mission, the selective type masks just lock heading and altitude. I’ve made a post here: Offboard control problem with fixed wing. Where can I get logs from? I have logs in build_posix_sitl_default/logs but theres also the qgroundcontrol ones. How can I give them?
I’ve looked through all of the fixed wing position control module and I don’t see any code to support the set_position_target_local_ned command…Could you point me to where in the position control file this is supported, or where else in the code? I know from mavlink_receiving.cpp it populates the position_sp_triplet msg but MC_pos_control has support for the local_position_setpoint but I dont see anything in fixed wing. Thanks.