Skip to content

Commit

Permalink
pwm_out_sim cleanup
Browse files Browse the repository at this point in the history
 - move to ModuleBase
 - strip down to PWM 8 and 16 modes only
 - remove all dead code
 - implement missing pwm ioctls (current value, rates, etc)
 - default rate 50Hz -> 400Hz
  • Loading branch information
dagar committed Mar 4, 2018
1 parent 3d68540 commit b9fe0e1
Show file tree
Hide file tree
Showing 40 changed files with 841 additions and 1,140 deletions.
2 changes: 1 addition & 1 deletion ROMFS/px4fmu_common/init.d/rcS
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ then

if [ $OUTPUT_MODE == hil ]
then
if pwm_out_sim mode_pwm16
if pwm_out_sim start
then
else
tune_control play -m ${TUNE_ERR}
Expand Down
2 changes: 1 addition & 1 deletion platforms/qurt/src/px4_layer/commands_hil.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const char *get_commands()
"mc_pos_control start\n"
"mc_att_control start\n"
"sleep 1\n"
"pwm_out_sim mode_pwm\n"
"pwm_out_sim start\n"
"param set RC1_MAX 2015\n"
"param set RC1_MIN 996\n"
"param set RC1_TRIM 1502\n"
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/ekf2/hippocampus
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dataman start

simulator start -s

pwm_out_sim mode_pwm
pwm_out_sim start
mixer load /dev/pwm_output0 ROMFS/px4fmu_test/mixers/uuv_quad_x.mix

gyrosim start
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/ekf2/iris
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ accelsim start
barosim start
adcsim start
gpssim start
pwm_out_sim mode_pwm
pwm_out_sim start
sensors start
commander start
land_detector start multicopter
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/ekf2/iris_1
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ accelsim start
barosim start
adcsim start
gpssim start
pwm_out_sim mode_pwm
pwm_out_sim start
sensors start
commander start
land_detector start multicopter
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/ekf2/iris_2
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ accelsim start
barosim start
adcsim start
gpssim start
pwm_out_sim mode_pwm
pwm_out_sim start
sensors start
commander start
land_detector start multicopter
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/ekf2/iris_irlock
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ accelsim start
barosim start
adcsim start
gpssim start
pwm_out_sim mode_pwm
pwm_out_sim start
sensors start
commander start
land_detector start multicopter
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/ekf2/iris_opt_flow
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ accelsim start
barosim start
adcsim start
gpssim start
pwm_out_sim mode_pwm
pwm_out_sim start
sensors start
commander start
land_detector start multicopter
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/ekf2/iris_rplidar
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ accelsim start
barosim start
adcsim start
gpssim start
pwm_out_sim mode_pwm
pwm_out_sim start
sensors start
commander start
land_detector start multicopter
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/ekf2/multiple_iris
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ accelsim start
barosim start
adcsim start
gpssim start
pwm_out_sim mode_pwm
pwm_out_sim start
sensors start
commander start
land_detector start multicopter
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/ekf2/plane
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ barosim start
adcsim start
gpssim start
measairspeedsim start
pwm_out_sim mode_pwm
pwm_out_sim start
sensors start
commander start
navigator start
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/ekf2/rover
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ barosim start
adcsim start
gpssim start
measairspeedsim start
pwm_out_sim mode_pwm
pwm_out_sim start
sleep 1
sensors start
commander start
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/ekf2/solo
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ accelsim start
barosim start
adcsim start
gpssim start
pwm_out_sim mode_pwm
pwm_out_sim start
sensors start
commander start
land_detector start multicopter
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/ekf2/standard_vtol
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ barosim start
adcsim start
gpssim start
measairspeedsim start
pwm_out_sim mode_pwm
pwm_out_sim start start
sensors start
commander start
land_detector start vtol
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/ekf2/tailsitter
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ barosim start
adcsim start
gpssim start
measairspeedsim start
pwm_out_sim mode_pwm
pwm_out_sim start
sensors start
commander start
land_detector start vtol
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/ekf2/tiltrotor
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ barosim start
adcsim start
gpssim start
measairspeedsim start
pwm_out_sim mode_pwm
pwm_out_sim start
sensors start
commander start
land_detector start vtol
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/ekf2/typhoon_h480
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ accelsim start
barosim start
adcsim start
gpssim start
pwm_out_sim mode_pwm16
pwm_out_sim start
sensors start
commander start
land_detector start multicopter
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/inav/iris
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ accelsim start
barosim start
adcsim start
gpssim start
pwm_out_sim mode_pwm
pwm_out_sim start
sensors start
commander start
land_detector start multicopter
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/inav/iris_opt_flow
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ accelsim start
barosim start
adcsim start
gpssim start
pwm_out_sim mode_pwm
pwm_out_sim start
sensors start
commander start
land_detector start multicopter
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/lpe/hippocampus
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dataman start

simulator start -s

pwm_out_sim mode_pwm
pwm_out_sim start
mixer load /dev/pwm_output0 ROMFS/px4fmu_test/mixers/uuv_quad_x.mix

gyrosim start
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/lpe/iris
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ accelsim start
barosim start
adcsim start
gpssim start
pwm_out_sim mode_pwm
pwm_out_sim start
sensors start
commander start
land_detector start multicopter
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/lpe/iris_1
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ accelsim start
barosim start
adcsim start
gpssim start
pwm_out_sim mode_pwm
pwm_out_sim start
sensors start
commander start
land_detector start multicopter
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/lpe/iris_2
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ accelsim start
barosim start
adcsim start
gpssim start
pwm_out_sim mode_pwm
pwm_out_sim start
sensors start
commander start
land_detector start multicopter
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/lpe/iris_irlock
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ accelsim start
barosim start
adcsim start
gpssim start
pwm_out_sim mode_pwm
pwm_out_sim start
sensors start
commander start
land_detector start multicopter
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/lpe/iris_opt_flow
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ accelsim start
barosim start
adcsim start
gpssim start
pwm_out_sim mode_pwm
pwm_out_sim start
sensors start
commander start
land_detector start multicopter
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/lpe/iris_rplidar
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ accelsim start
barosim start
adcsim start
gpssim start
pwm_out_sim mode_pwm
pwm_out_sim start
sleep 1
sensors start
commander start
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/lpe/plane
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ barosim start
adcsim start
gpssim start
measairspeedsim start
pwm_out_sim mode_pwm
pwm_out_sim start
sensors start
commander start
navigator start
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/lpe/rover
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ barosim start
adcsim start
gpssim start
measairspeedsim start
pwm_out_sim mode_pwm
pwm_out_sim start
sleep 1
sensors start
commander start
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/lpe/solo
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ accelsim start
barosim start
adcsim start
gpssim start
pwm_out_sim mode_pwm
pwm_out_sim start
sensors start
commander start
land_detector start multicopter
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/lpe/standard_vtol
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ barosim start
adcsim start
gpssim start
measairspeedsim start
pwm_out_sim mode_pwm
pwm_out_sim start
sensors start
commander start
land_detector start vtol
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/lpe/typhoon_h480
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ accelsim start
barosim start
adcsim start
gpssim start
pwm_out_sim mode_pwm16
pwm_out_sim start
sensors start
commander start
land_detector start multicopter
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/rcS_gazebo_delta_wing
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ barosim start
adcsim start
gpssim start
measairspeedsim start
pwm_out_sim mode_pwm
pwm_out_sim start
sensors start
commander start
navigator start
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/test/cmd_template.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ barosim start
adcsim start
gpssim start
measairspeedsim start
pwm_out_sim mode_pwm
pwm_out_sim start

ver all

Expand Down
2 changes: 1 addition & 1 deletion posix-configs/SITL/init/test/tests_template.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ barosim start
adcsim start
gpssim start
measairspeedsim start
pwm_out_sim mode_pwm
pwm_out_sim start

ver all

Expand Down
2 changes: 1 addition & 1 deletion posix-configs/eagle/hil/px4.config
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ mc_pos_control start
mc_att_control start
land_detector start multicopter
sleep 1
pwm_out_sim mode_pwm
pwm_out_sim start
mixer load /dev/pwm_output0 /startup/quad_x.main.mix
list_devices
list_files
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/rpi/px4_hil.config
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mc_pos_control start
mc_att_control start
mavlink start -x -u 14577 -r 1000000
navio_sysfs_rc_in start
pwm_out_sim mode_pwm16
pwm_out_sim start
mixer load /dev/pwm_output0 ROMFS/px4fmu_common/mixers/quad_x.main.mix
logger start -t -b 200
mavlink boot_complete
Expand Down
8 changes: 1 addition & 7 deletions src/drivers/pwm_out_sim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@
px4_add_module(
MODULE drivers__pwm_out_sim
MAIN pwm_out_sim
STACK_MAIN 1200
STACK_MAX 1200
COMPILE_FLAGS
SRCS
pwm_out_sim.cpp
DEPENDS
platforms__common
PWMSim.cpp
)
# vim: set noet ft=cmake fenc=utf-8 ff=unix :
Loading

0 comments on commit b9fe0e1

Please sign in to comment.