ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
11.02k stars 17.57k forks source link

Copter: add support for CONDITION_CHANGE_ALT #26227

Closed nraines2002 closed 9 months ago

nraines2002 commented 9 months ago

NOTE:

Sending CONDITION_CHANGE_ALT is not yet supported but similar commands are. See wiki: https://ardupilot.org/dev/docs/copter-commands-in-guided-mode.html

Bug report

Issue details

Sending MAVLink messages via Command_Int is returning COMMAND_ACK:[COMMAND_NAME]:UNSUPPORTED. I am using MAVROS built using ROS2 Foxy to pack and send these commands, using the Command_Long MAVROS service to send a Set_Mode message works but returns COMMAND_ACK:DO_SET_MODE:DENIED. I have sent the message with frames, MAV_FRAME_GLOBAL, MAV_FRAME_LOCAL_NED, MAV_FRAME_MISSION, MAV_FRAME_GLOBAL_RELATIVE_ALT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT to no avail.

Current usage:

auto request = std::make_shared<mavros_msgs::srv::CommandInt::Request>(); request->frame = mavros_msgs::msg::Waypoint::FRAME_GLOBAL_REL_ALT; request->command = 113; request->current = 0; request->autocontinue = 0; request->param1 = 0;
request->param2 = 0;
request->param3 = 0;
request->param4 = 0;
request->x = 0;
request->y = 0;
request->z = alt; (altitude in meters) ` auto result = commclient->async_send_request(request);`

Version Copter-4.4/4.3/4.2

Platform [ ] All [ ] AntennaTracker [X] Copter [ ] Plane [ ] Rover [ ] Submarine

Airframe type SITL

Hardware type None, used SITL

Logs

Current usage:

rmackay9 commented 9 months ago

@nraines2002,

Which version of AP is on the autopilot? 4.5.0 is required for many commands when using command_int.

amilcarlucas commented 9 months ago

This is a support question that I already answered on the forum.

nraines2002 commented 9 months ago

@nraines2002,

Which version of AP is on the autopilot? 4.5.0 is required for many commands when using command_int.

I was trying various different versions and just tried 4.5.0 with no luck.

image

nraines2002 commented 9 months ago

This is a support question that I already answered on the forum.

Thank you for your response. Using COMMAND_INT in 4.5.0 still gives me UNSUPPORTED however.

amilcarlucas commented 9 months ago

Then that command is not yet supported.You should change the title of this issue to: CONDITION_CHANGE_ALT COMMAND_INT unsupported

rmackay9 commented 9 months ago

OK, good that we're getting to the real issue now.

@nraines2002, have you seen this wiki page that documents how copters can be controlled using MAVLink?

I'm not too enthusiastic about adding support for CONDITION_CHANGE_ALT when we already have so many more capable alternatives.

nraines2002 commented 9 months ago

@rmackay9 I haven't seen that wiki, that's exactly what I needed.

The MAV_CMD_DO_REPOSITION command is all I need, thank you.

rmackay9 commented 9 months ago

@nraines2002,

great stuff. I'll go ahead and close this issue then. Txs for using AP!