diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-26 09:49:57 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-29 16:33:54 +0100 |
commit | 678d5c24fb978f0c18bb87a6894ed2922fe227ca (patch) | |
tree | b16a2ad73630ac8ef1f7b6e683666b7b6b3739b3 | |
parent | 455f6abfcf25e48edd4d707fdf9b278e02a81772 (diff) | |
download | px4-firmware-678d5c24fb978f0c18bb87a6894ed2922fe227ca.tar.gz px4-firmware-678d5c24fb978f0c18bb87a6894ed2922fe227ca.tar.bz2 px4-firmware-678d5c24fb978f0c18bb87a6894ed2922fe227ca.zip |
FMU driver: Move to topic groups
-rw-r--r-- | src/drivers/px4fmu/fmu.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/drivers/px4fmu/fmu.cpp b/src/drivers/px4fmu/fmu.cpp index 112c01513..363d2cdcf 100644 --- a/src/drivers/px4fmu/fmu.cpp +++ b/src/drivers/px4fmu/fmu.cpp @@ -141,7 +141,7 @@ private: int _control_subs[NUM_ACTUATOR_CONTROL_GROUPS]; actuator_controls_s _controls[NUM_ACTUATOR_CONTROL_GROUPS]; orb_id_t _control_topics[NUM_ACTUATOR_CONTROL_GROUPS]; - orb_id_t _actuator_output_topic; + int _actuator_output_topic_instance; pollfd _poll_fds[NUM_ACTUATOR_CONTROL_GROUPS]; unsigned _poll_fds_num; @@ -256,7 +256,7 @@ PX4FMU::PX4FMU() : _groups_required(0), _groups_subscribed(0), _control_subs{-1}, - _actuator_output_topic(nullptr), + _actuator_output_topic_instance(-1), _poll_fds_num(0), _pwm_limit{}, _failsafe_pwm{0}, @@ -327,8 +327,6 @@ PX4FMU::init() log("default PWM output device"); } - _actuator_output_topic = ORB_ID_DOUBLE(actuator_outputs_, _class_instance); - /* reset GPIOs */ gpio_reset(); @@ -679,10 +677,10 @@ PX4FMU::task_main() /* publish mixed control outputs */ if (_outputs_pub < 0) { - _outputs_pub = orb_advertise(_actuator_output_topic, &outputs); + _outputs_pub = orb_advertise_multi(ORB_ID(actuator_outputs), &outputs, &_actuator_output_topic_instance, ORB_PRIO_DEFAULT); } else { - orb_publish(_actuator_output_topic, _outputs_pub, &outputs); + orb_publish(ORB_ID(actuator_outputs), _outputs_pub, &outputs); } } } |