aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/px4io/px4io.cpp
diff options
context:
space:
mode:
authorJulian Oes <julian@oes.ch>2013-06-25 13:15:38 +0200
committerJulian Oes <julian@oes.ch>2013-06-25 13:15:38 +0200
commita6ba7e448586c556009132887503e6830c20029e (patch)
tree4186eb8d3c233c01e0e3ce6318d65c43366d6b97 /src/drivers/px4io/px4io.cpp
parent2096da2d4da2d4482dcdb328d35255101fc722bd (diff)
downloadpx4-firmware-a6ba7e448586c556009132887503e6830c20029e.tar.gz
px4-firmware-a6ba7e448586c556009132887503e6830c20029e.tar.bz2
px4-firmware-a6ba7e448586c556009132887503e6830c20029e.zip
Dropped superseded safety topic, added warning tones before arming
Diffstat (limited to 'src/drivers/px4io/px4io.cpp')
-rw-r--r--src/drivers/px4io/px4io.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp
index 6d3c32ed9..df2f18270 100644
--- a/src/drivers/px4io/px4io.cpp
+++ b/src/drivers/px4io/px4io.cpp
@@ -81,7 +81,6 @@
#include <uORB/topics/rc_channels.h>
#include <uORB/topics/battery_status.h>
#include <uORB/topics/parameter_update.h>
-#include <uORB/topics/safety.h>
#include <debug.h>
#include <mavlink/mavlink_log.h>
@@ -990,20 +989,24 @@ PX4IO::io_handle_status(uint16_t status)
/**
* Get and handle the safety status
*/
- struct safety_s safety;
+ struct actuator_safety_s safety;
safety.timestamp = hrt_absolute_time();
+ orb_copy(ORB_ID(actuator_safety), _t_actuator_safety, &safety);
+
if (status & PX4IO_P_STATUS_FLAGS_SAFETY_OFF) {
- safety.status = SAFETY_STATUS_UNLOCKED;
+ safety.safety_off = true;
+ safety.safety_switch_available = true;
} else {
- safety.status = SAFETY_STATUS_SAFE;
+ safety.safety_off = false;
+ safety.safety_switch_available = true;
}
/* lazily publish the safety status */
if (_to_safety > 0) {
- orb_publish(ORB_ID(safety), _to_safety, &safety);
+ orb_publish(ORB_ID(actuator_safety), _to_safety, &safety);
} else {
- _to_safety = orb_advertise(ORB_ID(safety), &safety);
+ _to_safety = orb_advertise(ORB_ID(actuator_safety), &safety);
}
return ret;