mavlink / mavros

MAVLink to ROS gateway with proxy for Ground Control Station
Other
875 stars 988 forks source link

Feature Request: Support FCU shutdown/reboot from OBC #744

Open anuppari opened 7 years ago

anuppari commented 7 years ago

Currently there is no way to signal a reboot of the FCU if e.g., some parameters are changed or there is a bad boot. This feature is available in QGC, so presumably it can be done through mavlink?

MAVROS version and platform

Mavros: 0.19 ROS: Kinetic Ubuntu: 16.04

TSC21 commented 7 years ago

Duplicated of #333. You are welcomed to make a PR with what that feature to be reviewed.

anuppari commented 7 years ago

This is not a duplicate of #333, this is the opposite. #333 asks to shutdown the OBC from the FCU (or GCS), this issue is to shutdown the FCU from the OBC. Please reopen.

TSC21 commented 7 years ago

Sorry misunderstood. Still, you are welcomed to add the support. We will gladly review it.

TSC21 commented 7 years ago

@anuppari any updates on this? Have you tried to implement the feature already?

vooon commented 7 years ago

I'm pretty sure that all what you need is call COMMAND_LONG with desired cmd code, so you may use ~cmd/long service to do that.

TSC21 commented 7 years ago

@anuppari MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN is the command code you want, having parameter 1 set to 1. You can create a script for that (PR welcomed) or you can use raw cmd/long srv as @vooon stated to that same purpose.

anuppari commented 7 years ago

Thanks for the info. How can I access the mavlink enumerations (is there a mavros header that defines these)? Or do I just have to hardcode the value (e.g., 246)?

TSC21 commented 7 years ago

http://mavlink.org/messages/common

TSC21 commented 7 years ago

MAVROS uses the enumerations defined on the Mavlink msg definitions supported on the Mavlink ROS package

hardeman commented 4 years ago

Is this feature already available?

TSC21 commented 4 years ago

Is this feature already available?

No.

shakeebbb commented 4 years ago

I am using PX4 simulator in gazebo. rosservice call /mavros/cmd/command "{broadcast: false, command: 246, confirmation: 0, param1: 2, param2: 0.0, param3: 0.0, param4: 0.0, param5: 0.0, param6: 0.0, param7: 0.0}" seems to shut PX4 down with success: True.

However, the service call below returns success: False, result: 2 and does not reboot PX4. rosservice call /mavros/cmd/command "{broadcast: false, command: 246, confirmation: 0, param1: 1, param2: 0.0, param3: 0.0, param4: 0.0, param5: 0.0, param6: 0.0, param7: 0.0}".

Is there anything I am missing? What are broadcast and confirmation variables used for inside the mavros_msgs/CommandLong.srv? Thanks in advance!

amilcarlucas commented 3 years ago

@shakeebbb thanks for the tip. That flight controller reboot rosservice call works fine on ArduPilot.