diff options
author | Andreas Antener <antener_a@gmx.ch> | 2015-02-22 12:35:45 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2015-02-28 18:25:36 +0100 |
commit | cbbc660b88917fd0c4cf3fe54ca5c769775e7ae9 (patch) | |
tree | 9cf1604bd6ef75b29df78169670c7df9d9fea859 /src/platforms/ros/nodes/commander/commander.cpp | |
parent | e5d54a487fbca638a52d8c5a12ef4374680cdf96 (diff) | |
download | px4-firmware-cbbc660b88917fd0c4cf3fe54ca5c769775e7ae9.tar.gz px4-firmware-cbbc660b88917fd0c4cf3fe54ca5c769775e7ae9.tar.bz2 px4-firmware-cbbc660b88917fd0c4cf3fe54ca5c769775e7ae9.zip |
arm automatically when offboard control mode is set
Diffstat (limited to 'src/platforms/ros/nodes/commander/commander.cpp')
-rw-r--r-- | src/platforms/ros/nodes/commander/commander.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/platforms/ros/nodes/commander/commander.cpp b/src/platforms/ros/nodes/commander/commander.cpp index 9ca54339d..0c32026f3 100644 --- a/src/platforms/ros/nodes/commander/commander.cpp +++ b/src/platforms/ros/nodes/commander/commander.cpp @@ -205,8 +205,25 @@ void Commander::OffboardControlModeCallback(const px4::offboard_control_modeCons /* Force system into offboard control mode */ if (!_got_manual_control) { SetOffboardControl(_msg_offboard_control_mode, _msg_vehicle_control_mode); + + px4::vehicle_status msg_vehicle_status; + msg_vehicle_status.timestamp = px4::get_time_micros(); + msg_vehicle_status.hil_state = msg_vehicle_status.HIL_STATE_OFF; + msg_vehicle_status.hil_state = msg_vehicle_status.VEHICLE_TYPE_QUADROTOR; + msg_vehicle_status.is_rotary_wing = true; + msg_vehicle_status.arming_state = msg_vehicle_status.ARMING_STATE_ARMED; + + + _msg_actuator_armed.armed = true; + _msg_actuator_armed.timestamp = px4::get_time_micros(); + _msg_vehicle_control_mode.timestamp = px4::get_time_micros(); + _msg_vehicle_control_mode.flag_armed = true; + + _vehicle_control_mode_pub.publish(_msg_vehicle_control_mode); + _actuator_armed_pub.publish(_msg_actuator_armed); + _vehicle_status_pub.publish(msg_vehicle_status); } } |