diff options
author | Daniel Agar <daniel@agar.ca> | 2015-03-03 11:47:27 -0500 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-03-19 23:49:36 +0100 |
commit | 662ec3f62f6c271d7746204888c2d55e3c3bd86e (patch) | |
tree | 55b9134a2fdc223e2261905d750104e6178c5df2 /src/examples/rover_steering_control | |
parent | 0eaf41a048074d5ebf6b84094cfd69ef10451180 (diff) | |
download | px4-firmware-662ec3f62f6c271d7746204888c2d55e3c3bd86e.tar.gz px4-firmware-662ec3f62f6c271d7746204888c2d55e3c3bd86e.tar.bz2 px4-firmware-662ec3f62f6c271d7746204888c2d55e3c3bd86e.zip |
examples fix code style
Diffstat (limited to 'src/examples/rover_steering_control')
-rw-r--r-- | src/examples/rover_steering_control/main.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/examples/rover_steering_control/main.cpp b/src/examples/rover_steering_control/main.cpp index 7ef914098..0f8eb800e 100644 --- a/src/examples/rover_steering_control/main.cpp +++ b/src/examples/rover_steering_control/main.cpp @@ -267,18 +267,27 @@ int rover_steering_control_thread_main(int argc, char *argv[]) /* subscribe to topics. */ int att_sub = orb_subscribe(ORB_ID(vehicle_attitude)); + int global_pos_sub = orb_subscribe(ORB_ID(vehicle_global_position)); + int manual_sp_sub = orb_subscribe(ORB_ID(manual_control_setpoint)); + int vstatus_sub = orb_subscribe(ORB_ID(vehicle_status)); + int att_sp_sub = orb_subscribe(ORB_ID(vehicle_attitude_setpoint)); + int param_sub = orb_subscribe(ORB_ID(parameter_update)); /* Setup of loop */ struct pollfd fds[2]; + fds[0].fd = param_sub; + fds[0].events = POLLIN; + fds[1].fd = att_sub; + fds[1].events = POLLIN; while (!thread_should_exit) { @@ -371,6 +380,7 @@ int rover_steering_control_thread_main(int argc, char *argv[]) for (unsigned i = 0; i < (sizeof(actuators.control) / sizeof(actuators.control[0])); i++) { actuators.control[i] = 0.0f; } + actuators.timestamp = hrt_absolute_time(); orb_publish(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, actuator_pub, &actuators); @@ -421,7 +431,7 @@ int rover_steering_control_main(int argc, char *argv[]) SCHED_PRIORITY_MAX - 20, 2048, rover_steering_control_thread_main, - (argv) ? (char *const *)&argv[2] : (char *const *)NULL); + (argv) ? (char * const *)&argv[2] : (char * const *)NULL); thread_running = true; exit(0); } |