Skip to content

Commit

Permalink
include all RC buttons in joystick
Browse files Browse the repository at this point in the history
  • Loading branch information
sytelus committed May 3, 2017
1 parent d48889c commit 298169f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class RosFlightDroneController : public DroneControllerBase {
board_->setInputChannel(5, switchToPwm(rcData.switch2));
board_->setInputChannel(6, switchToPwm(rcData.switch3));
board_->setInputChannel(7, switchToPwm(rcData.switch4));
board_->setInputChannel(8, switchToPwm(rcData.switch5));
board_->setInputChannel(8, switchToPwm(rcData.switch5)); //arm/disarm
}
//else we don't have RC data
}
Expand Down
4 changes: 2 additions & 2 deletions AirLib/include/controllers/rosflight/firmware/commonstate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ class CommonState {
}
void set_disarm()
{
_armed_state = armed_state_t::DISARMED;
setArmedState(armed_state_t::DISARMED);
}
void set_arm()
{
_armed_state = armed_state_t::ARMED;
setArmedState(armed_state_t::ARMED);
}

static std::string stringf(const char* format, ...)
Expand Down
Binary file modified Unreal/Plugins/AirSim/Dependencies/x360ce/x360ce.ini
Binary file not shown.
2 changes: 1 addition & 1 deletion Unreal/Plugins/AirSim/Source/AirBlueprintLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void UAirBlueprintLib::LogMessage(const FString &prefix, const FString &suffix,

FColor color;
switch (level) {
case LogDebugLevel::Informational: color = FColor(100, 100, 250); break;
case LogDebugLevel::Informational: color = FColor::Blue; break;
case LogDebugLevel::Success: color = FColor::Green; break;
case LogDebugLevel::Failure: color = FColor::Red; break;
case LogDebugLevel::Unimportant: color = FColor::Silver; break;
Expand Down
6 changes: 5 additions & 1 deletion Unreal/Plugins/AirSim/Source/MultiRotorConnector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,13 @@ const msr::airlib::RCData& MultiRotorConnector::getRCData()
rc_data_.switch1 = joystick_state_.left_trigger ? 1 : 0;
rc_data_.switch2 = joystick_state_.right_trigger ? 1 : 0;

UAirBlueprintLib::LogMessage(FString("Joystick: "),
UAirBlueprintLib::LogMessage(FString("Joystick (T,R,P,Y): "),
FString::SanitizeFloat(rc_data_.throttle) + ", " + FString::SanitizeFloat(rc_data_.roll) + ", " + FString::SanitizeFloat(rc_data_.pitch) + ", " + FString::SanitizeFloat(rc_data_.yaw),
LogDebugLevel::Informational);
UAirBlueprintLib::LogMessage(FString("Joystick (Switches): "), FString::FromInt(joystick_state_.buttons) + ", " +
FString::FromInt(rc_data_.switch1) + ", " + FString::FromInt(rc_data_.switch2) + ", " + FString::FromInt(rc_data_.switch3) + ", " + FString::FromInt(rc_data_.switch4)
+ ", " + FString::FromInt(rc_data_.switch5),
LogDebugLevel::Informational);
}
//else don't waste time

Expand Down

0 comments on commit 298169f

Please sign in to comment.