diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-05-07 14:14:31 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-05-07 14:14:31 +0200 |
commit | 6a6feaf96cc6c4cfb6fdae25c9a0ac8a4e5809cc (patch) | |
tree | 654f7a648ee00f12ec25ee28143a74e6041c18a6 /src/drivers/px4io/px4io.cpp | |
parent | 319ce3de1005d7199a992b227c7e75acb9db376b (diff) | |
parent | 9f2d65eff53e88f1c0674766f2f9ef6be04875c0 (diff) | |
download | px4-firmware-6a6feaf96cc6c4cfb6fdae25c9a0ac8a4e5809cc.tar.gz px4-firmware-6a6feaf96cc6c4cfb6fdae25c9a0ac8a4e5809cc.tar.bz2 px4-firmware-6a6feaf96cc6c4cfb6fdae25c9a0ac8a4e5809cc.zip |
Merged master
Diffstat (limited to 'src/drivers/px4io/px4io.cpp')
-rw-r--r-- | src/drivers/px4io/px4io.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp index 8458c2fdb..aec6dd3b7 100644 --- a/src/drivers/px4io/px4io.cpp +++ b/src/drivers/px4io/px4io.cpp @@ -683,6 +683,25 @@ PX4IO::init() /* send command to arm system via command API */ vehicle_command_s cmd; + /* send this to itself */ + param_t sys_id_param = param_find("MAV_SYS_ID"); + param_t comp_id_param = param_find("MAV_COMP_ID"); + + int32_t sys_id; + int32_t comp_id; + + if (param_get(sys_id_param, &sys_id)) { + errx(1, "PRM SYSID"); + } + + if (param_get(comp_id_param, &comp_id)) { + errx(1, "PRM CMPID"); + } + + cmd.target_system = sys_id; + cmd.target_component = comp_id; + cmd.source_system = sys_id; + cmd.source_component = comp_id; /* request arming */ cmd.param1 = 1.0f; cmd.param2 = 0; @@ -692,10 +711,7 @@ PX4IO::init() cmd.param6 = 0; cmd.param7 = 0; cmd.command = VEHICLE_CMD_COMPONENT_ARM_DISARM; - // cmd.target_system = status.system_id; - // cmd.target_component = status.component_id; - // cmd.source_system = status.system_id; - // cmd.source_component = status.component_id; + /* ask to confirm command */ cmd.confirmation = 1; |