diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-12-31 14:43:55 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-12-31 14:43:55 +0100 |
commit | 3684ac6bf1fdbaeb18686768d013f28ad75122ff (patch) | |
tree | b2b01c568ccbdbbd36a7ba5f5cdd733ac90a958b /src/platforms/ros/nodes | |
parent | f8214f3e0162fcbd0ca9382b0d00bdab2f5863ee (diff) | |
download | px4-firmware-3684ac6bf1fdbaeb18686768d013f28ad75122ff.tar.gz px4-firmware-3684ac6bf1fdbaeb18686768d013f28ad75122ff.tar.bz2 px4-firmware-3684ac6bf1fdbaeb18686768d013f28ad75122ff.zip |
fix dummy mixer
Diffstat (limited to 'src/platforms/ros/nodes')
-rw-r--r-- | src/platforms/ros/nodes/mc_mixer/mc_mixer.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/platforms/ros/nodes/mc_mixer/mc_mixer.cpp b/src/platforms/ros/nodes/mc_mixer/mc_mixer.cpp index 61ee13ecd..04d7888fb 100644 --- a/src/platforms/ros/nodes/mc_mixer/mc_mixer.cpp +++ b/src/platforms/ros/nodes/mc_mixer/mc_mixer.cpp @@ -77,24 +77,33 @@ private: }; const MultirotorMixer::Rotor _config_x[] = { - { 0.000000, -1.000000, -1.00 }, - { -0.000000, 1.000000, -1.00 }, - { 1.000000, 0.000000, 1.00 }, + { -0.707107, 0.707107, 1.00 }, + { 0.707107, -0.707107, 1.00 }, + { 0.707107, 0.707107, -1.00 }, + { -0.707107, -0.707107, -1.00 }, +}; + +const MultirotorMixer::Rotor _config_quad_plus[] = { { -1.000000, 0.000000, 1.00 }, + { 1.000000, 0.000000, 1.00 }, + { 0.000000, 1.000000, -1.00 }, + { -0.000000, -1.000000, -1.00 }, }; - const MultirotorMixer::Rotor *_config_index = { &_config_x[0] - }; +const MultirotorMixer::Rotor *_config_index[3] = { + &_config_x[0], + &_config_quad_plus[0], +}; MultirotorMixer::MultirotorMixer(): _n(), _rotor_count(4), - _rotors(_config_index) + _rotors(_config_index[1]) //XXX +config hardcoded { _sub = _n.subscribe("actuator_controls_0", 1000, &MultirotorMixer::actuatorControlsCallback,this); _pub = _n.advertise<mav_msgs::MotorSpeed>("/mixed_motor_commands",10); if (!_n.hasParam("motor_scaling_radps")) { - _n.setParam("motor_scaling_radps", 2000.0); + _n.setParam("motor_scaling_radps", 1500.0); } } |