Goliath II
Controller Receiver
 All Classes Namespaces Files Functions Enumerations
Enumerations | Functions
convert.h File Reference
#include <iostream>
#include <MessageCarrier.pb.h>
#include <boost/log/trivial.hpp>
#include <deque>
#include "config.h"
#include "control.h"
#include "map.h"

Go to the source code of this file.

Enumerations

enum  TYPE { CONTROL_TYPE = 0, CONFIG_TYPE = 1, LAST_STATUS_TYPE = 2, COMMAND_TYPE = 3 }
 enum for all input types
 

Functions

goliath::proto::MessageCarrier dualJoystickToMove (CONTROL control, int value)
 Converts joystick movement into Message with a MoveCommand. More...
 
goliath::proto::MessageCarrier buttonToFrontWing (CONTROL control, int value)
 Converts button presses to message with MoveWingCommand for front wings. More...
 
goliath::proto::MessageCarrier buttonToBackWing (CONTROL control, int value)
 Converts button presses to message with MoveWingCommand for back wings. More...
 
goliath::proto::MessageCarrier buttonToAllWing (CONTROL control, int value)
 Converts button presses to message with MoveWingCommand for front/back wings. More...
 
goliath::proto::MessageCarrier inputToCommand (goliath::proto::CommandMessage::CommandCase command, int value=0)
 
goliath::proto::MessageCarrier convertControl (CONTROL control, int value, std::map< CONTROL, std::function< goliath::proto::MessageCarrier(CONTROL, int)>> function)
 Calls function mapped to the input. More...
 
goliath::proto::MessageCarrier toMoveWingMessage (goliath::proto::commands::ServoCommand_Motor wing, goliath::proto::commands::ServoCommand_Direction direction, int speed)
 Converts input to Message with MoveWingCommand. More...
 
goliath::proto::MessageCarrier toMoveWingMessage (std::vector< commands::ServoCommand_Motor > wings, commands::ServoCommand_Direction direction, int speed)
 
TYPE stringToType (std::string string)
 Converts type string from controller to TYPE enum. More...
 
goliath::proto::CommandMessage::CommandCase stringToCommandCase (std::string string)
 Converts command string from controller to CommandCase. More...
 

Detailed Description

Author
Group 7 - Informatica

Function Documentation

goliath::proto::MessageCarrier buttonToAllWing ( CONTROL  control,
int  value 
)

Converts button presses to message with MoveWingCommand for front/back wings.

Parameters
controlButton or axis
valueValue of button or axis
goliath::proto::MessageCarrier buttonToBackWing ( CONTROL  control,
int  value 
)

Converts button presses to message with MoveWingCommand for back wings.

Parameters
controlButton or axis
valueValue of button or axis
goliath::proto::MessageCarrier buttonToFrontWing ( CONTROL  control,
int  value 
)

Converts button presses to message with MoveWingCommand for front wings.

Parameters
controlButton or axis
valueValue of button or axis
goliath::proto::MessageCarrier convertControl ( CONTROL  control,
int  value,
std::map< CONTROL, std::function< goliath::proto::MessageCarrier(CONTROL, int)>>  function 
)

Calls function mapped to the input.

Parameters
controlButton or axis
valueValue of button or axis
goliath::proto::MessageCarrier dualJoystickToMove ( CONTROL  control,
int  value 
)

Converts joystick movement into Message with a MoveCommand.

Parameters
controlButton or axis
valueValue of button or axis
goliath::proto::CommandMessage::CommandCase stringToCommandCase ( std::string  string)

Converts command string from controller to CommandCase.

Parameters
stringstring to convert to CommandCase
TYPE stringToType ( std::string  string)

Converts type string from controller to TYPE enum.

Parameters
stringType of input
goliath::proto::MessageCarrier toMoveWingMessage ( goliath::proto::commands::ServoCommand_Motor  wing,
goliath::proto::commands::ServoCommand_Direction  direction,
int  speed 
)

Converts input to Message with MoveWingCommand.

Parameters
wingsingle wing
directionDirection to move the wing in
speedSpeed to move the wing