diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-07-07 10:59:43 -0700 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-07-07 10:59:43 -0700 |
commit | cf2dbdf9a1ae06c7d0e0a7963916a3709a1bc075 (patch) | |
tree | 79cb506ef7dbc1a7c1045f68b5ce8c169683c41e /src/modules/mavlink/mavlink.c | |
parent | 7cf121472e7ba3d83084083792b0f159f238a8ef (diff) | |
parent | 422c675c551c4a160e8bcdb18ffe3c6160b63980 (diff) | |
download | px4-firmware-cf2dbdf9a1ae06c7d0e0a7963916a3709a1bc075.tar.gz px4-firmware-cf2dbdf9a1ae06c7d0e0a7963916a3709a1bc075.tar.bz2 px4-firmware-cf2dbdf9a1ae06c7d0e0a7963916a3709a1bc075.zip |
Merge pull request #320 from PX4/integration
NuttX integration merge
Diffstat (limited to 'src/modules/mavlink/mavlink.c')
-rw-r--r-- | src/modules/mavlink/mavlink.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/modules/mavlink/mavlink.c b/src/modules/mavlink/mavlink.c index de78cd139..5b8345e7e 100644 --- a/src/modules/mavlink/mavlink.c +++ b/src/modules/mavlink/mavlink.c @@ -144,14 +144,6 @@ set_hil_on_off(bool hil_enabled) /* Enable HIL */ if (hil_enabled && !mavlink_hil_enabled) { - /* Advertise topics */ - pub_hil_attitude = orb_advertise(ORB_ID(vehicle_attitude), &hil_attitude); - pub_hil_global_pos = orb_advertise(ORB_ID(vehicle_global_position), &hil_global_pos); - - /* sensore level hil */ - pub_hil_sensors = orb_advertise(ORB_ID(sensor_combined), &hil_sensors); - pub_hil_gps = orb_advertise(ORB_ID(vehicle_gps_position), &hil_gps); - mavlink_hil_enabled = true; /* ramp up some HIL-related subscriptions */ @@ -714,6 +706,8 @@ int mavlink_thread_main(int argc, char *argv[]) lowspeed_counter++; + mavlink_waypoint_eventloop(mavlink_missionlib_get_system_timestamp(), &global_pos, &local_pos); + /* sleep quarter the time */ usleep(25000); @@ -725,10 +719,13 @@ int mavlink_thread_main(int argc, char *argv[]) /* send parameters at 20 Hz (if queued for sending) */ mavlink_pm_queued_send(); + mavlink_waypoint_eventloop(mavlink_missionlib_get_system_timestamp(), &global_pos, &local_pos); /* sleep quarter the time */ usleep(25000); + mavlink_waypoint_eventloop(mavlink_missionlib_get_system_timestamp(), &global_pos, &local_pos); + if (baudrate > 57600) { mavlink_pm_queued_send(); } @@ -787,7 +784,7 @@ int mavlink_main(int argc, char *argv[]) errx(0, "mavlink already running\n"); thread_should_exit = false; - mavlink_task = task_spawn("mavlink", + mavlink_task = task_spawn_cmd("mavlink", SCHED_DEFAULT, SCHED_PRIORITY_DEFAULT, 2048, |