mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 09:23:33 +08:00
examples fix code style
This commit is contained in:
committed by
Lorenz Meier
parent
0eaf41a048
commit
662ec3f62f
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user