RosMsgPrinter.cpp
Go to the documentation of this file.
00001 #include "r2_msgs/RosMsgPrinter.h"
00002 
00003 std::string RosMsgPrinter::powerStateToString(const r2_msgs::PowerState& powerState)
00004 {
00005     switch (powerState.data)
00006     {
00007         case r2_msgs::PowerState::LOGIC_POWER:
00008             return "LOGIC_POWER";
00009 
00010         case r2_msgs::PowerState::MOTOR48_POWER:
00011             return "MOTOR48_POWER";
00012 
00013         case r2_msgs::PowerState::MOTOR96_POWER:
00014             return "MOTOR96_POWER";
00015 
00016         case r2_msgs::PowerState::MOTOR_POWER:
00017             return "MOTOR_POWER";
00018 
00019         case r2_msgs::PowerState::POWER_OFF:
00020             return "POWER_OFF";
00021 
00022         case r2_msgs::PowerState::TRANSITIONING:
00023             return "TRANSITIONING";
00024 
00025         default:
00026             return "UNKNOWN";
00027     }
00028 }
00029 
00030 std::string RosMsgPrinter::jointControlModeToString(const r2_msgs::JointControlMode& controlMode)
00031 {
00032     switch (controlMode.state)
00033     {
00034         case r2_msgs::JointControlMode::IGNORE:
00035             return "IGNORE";
00036 
00037         case r2_msgs::JointControlMode::INVALID:
00038             return "INVALID";
00039 
00040         case r2_msgs::JointControlMode::BOOTLOADER:
00041             return "BOOTLOADER";
00042 
00043         case r2_msgs::JointControlMode::FAULTED:
00044             return "FAULTED";
00045 
00046         case r2_msgs::JointControlMode::OFF:
00047             return "OFF";
00048 
00049         case r2_msgs::JointControlMode::PARK:
00050             return "PARK";
00051 
00052         case r2_msgs::JointControlMode::NEUTRAL:
00053             return "NEUTRAL";
00054 
00055         case r2_msgs::JointControlMode::DRIVE:
00056             return "DRIVE";
00057 
00058         default:
00059             return "UNDEFINED";
00060     }
00061 }
00062 
00063 std::string RosMsgPrinter::jointControlCommandModeToString(const r2_msgs::JointControlCommandMode& commandMode)
00064 {
00065     switch (commandMode.state)
00066     {
00067         case r2_msgs::JointControlCommandMode::IGNORE:
00068             return "IGNORE";
00069 
00070         case r2_msgs::JointControlCommandMode::INVALID:
00071             return "INVALID";
00072 
00073         case r2_msgs::JointControlCommandMode::MOTCOM:
00074             return "MOTCOM";
00075 
00076         case r2_msgs::JointControlCommandMode::MULTILOOPSTEP:
00077             return "MULTILOOPSTEP";
00078 
00079         case r2_msgs::JointControlCommandMode::MULTILOOPSMOOTH:
00080             return "MULTILOOPSMOOTH";
00081 
00082         case r2_msgs::JointControlCommandMode::ACTUATOR:
00083             return "ACTUATOR";
00084 
00085         default:
00086             return "UNDEFINED";
00087     }
00088 }
00089 
00090 std::string RosMsgPrinter::jointControlCalibrationModeToString(const r2_msgs::JointControlCalibrationMode& calibrationMode)
00091 {
00092     switch (calibrationMode.state)
00093     {
00094         case r2_msgs::JointControlCalibrationMode::IGNORE:
00095             return "IGNORE";
00096 
00097         case r2_msgs::JointControlCalibrationMode::DISABLE:
00098             return "DISABLE";
00099 
00100         case r2_msgs::JointControlCalibrationMode::ENABLE:
00101             return "ENABLE";
00102 
00103         case r2_msgs::JointControlCalibrationMode::UNCALIBRATED:
00104             return "UNCALIBRATED";
00105 
00106         default:
00107             return "UNDEFINED";
00108     }
00109 }
00110 
00111 std::string RosMsgPrinter::jointControlClearFaultModeToString(const r2_msgs::JointControlClearFaultMode& clearFaultMode)
00112 {
00113     switch (clearFaultMode.state)
00114     {
00115         case r2_msgs::JointControlClearFaultMode::IGNORE:
00116             return "IGNORE";
00117 
00118         case r2_msgs::JointControlClearFaultMode::DISABLE:
00119             return "DISABLE";
00120 
00121         case r2_msgs::JointControlClearFaultMode::ENABLE:
00122             return "ENABLE";
00123 
00124         default:
00125             return "UNDEFINED";
00126     }
00127 }
00128 
00129 std::string RosMsgPrinter::jointControlCoeffsLoadedStateToString(const r2_msgs::JointControlCoeffState& coeffState)
00130 {
00131     switch (coeffState.state)
00132     {
00133         case r2_msgs::JointControlCoeffState::LOADED:
00134             return "LOADED";
00135 
00136         case r2_msgs::JointControlCoeffState::NOTLOADED:
00137             return "NOTLOADED";
00138 
00139         default:
00140             return "UNDEFINED";
00141     }
00142 }


r2_msgs
Author(s):
autogenerated on Sat Jun 15 2019 19:22:12