#include <RmpInterface.h>
Public Member Functions | |
bool | ChangeOperationalMode (RmpOperationalModeRequest modeRequest) |
void | GetFaultStatusDescription (FaultStatusDescription &rDescription) |
template<typename T > | |
T | GetUserDefinedFeedback (UserDefinedFeedbackType type) |
virtual void | Initialize (const std::string &rIpAddress, uint16_t portNumber) |
virtual void | Initialize (const std::string &rDevicePort) |
bool | ResetIntegrators (uint32_t bitmap) |
bool | ResetParamsToDefault () |
RmpInterface () | |
template<typename T > | |
bool | SetConfiguration (const RmpConfigurationCommand< T > &rConfigurationCommand, T value) |
template<> | |
bool | SetConfiguration (const RmpConfigurationCommand< uint32_t > &rConfigurationCommand, uint32_t value) |
template<> | |
bool | SetConfiguration (const RmpConfigurationCommand< float > &rConfigurationCommand, float value) |
bool | SetUserDefinedFeedbackBitmap (UserDefinedFeedbackBitmapType bitmapType, const uint32_t bitmap) |
virtual void | ShutDown () |
virtual bool | Update (bool forceUpdate=false) |
virtual | ~RmpInterface () |
Protected Member Functions | |
size_t | GetFeedbackEntryCount () |
void | Initialize () |
void | InitializeFeedbackBitmaps () |
bool | IsValidFeedbackBitmap (const RmpConfigurationCommand< uint32_t > &rConfigurationCommand, const uint32_t bitmap) |
bool | SendConfigurationCommand (uint16_t commandId, uint32_t value) |
bool | SetConfiguration (uint16_t commandId, UserDefinedFeedbackType feedbackType, uint32_t value) |
void | UpdateUserDefinedFeedback (const Bytes &rBytes) |
Protected Attributes | |
uint32_t | m_FeedbackBitmap [FEEDBACK_TYPE_NBR] |
bool | m_IsFeedbackBitmapSet |
RmpTransport::Ptr | m_pTransport |
uint32_t | m_UserDefinedFeedback [FEEDBACK_TYPE_NBR][MAX_ENTRIES_PER_FEEDBACK] |
This class provides an interface to a rmp platform. Please refer to the rmp user manual to understand the technical terms.
Definition at line 55 of file RmpInterface.h.
Constructor
Definition at line 58 of file RmpInterface.cpp.
segway::RmpInterface::~RmpInterface | ( | ) | [virtual] |
Destructor
Definition at line 66 of file RmpInterface.cpp.
bool segway::RmpInterface::ChangeOperationalMode | ( | RmpOperationalModeRequest | modeRequest | ) |
Change operational mode
modeRequest | desired operational mode. Defined in RmpUserDefinedFeedbackType.h. |
std::logic_error | if modeRequest is not valid |
Definition at line 406 of file RmpInterface.cpp.
void segway::RmpInterface::GetFaultStatusDescription | ( | FaultStatusDescription & | rDescription | ) |
Get a fault status description. This method returns a list of string describing a fault. An empty list means not fault.
rDescription | returned fault status description |
Definition at line 474 of file RmpInterface.cpp.
size_t segway::RmpInterface::GetFeedbackEntryCount | ( | ) | [protected] |
Get the number of feedback entries
Definition at line 643 of file RmpInterface.cpp.
Get a user defined feedback
type | type of user defined feedback. Defined in RmpUserDefinedFeedbackType.h. |
std::logic_error | if called with template parameter different than uint32_t or float |
Definition at line 188 of file RmpInterface.cpp.
void segway::RmpInterface::Initialize | ( | const std::string & | rIpAddress, |
uint16_t | portNumber | ||
) | [virtual] |
Initialize a udp communication
rIpAddress | ip address of the rmp |
portNumber | port number of the rmp |
std::logic_error | if the transport has already been initialized and has not been shut down |
Definition at line 71 of file RmpInterface.cpp.
void segway::RmpInterface::Initialize | ( | const std::string & | rDevicePort | ) | [virtual] |
Initialize a usb communication
rDevicePort |
std::logic_error | if the transport has already been initialized and has not been shut down |
Definition at line 83 of file RmpInterface.cpp.
void segway::RmpInterface::Initialize | ( | ) | [protected] |
Protected initialization method Initialize the user defined feedback bitmaps and switch to tractor mode
std::runtime_error | if unable to initialize feedback bitmpas properly |
std::runtime_error | if unable to set the rmp in tractor mode |
Definition at line 510 of file RmpInterface.cpp.
void segway::RmpInterface::InitializeFeedbackBitmaps | ( | ) | [protected] |
Get the uder defined feedback bitmap (configuration) from the rmp and update the state representation accordingly
std::runtime_error | if unable to initialize feedback bitmpas properly |
Definition at line 521 of file RmpInterface.cpp.
bool segway::RmpInterface::IsValidFeedbackBitmap | ( | const RmpConfigurationCommand< uint32_t > & | rConfigurationCommand, |
const uint32_t | bitmap | ||
) | [protected] |
Check wether the feedback bitmap is valid
rConfigurationCommand | bitmap configuration command |
bitmap | bitmap |
Definition at line 682 of file RmpInterface.cpp.
bool segway::RmpInterface::ResetIntegrators | ( | uint32_t | bitmap | ) |
Reset position data on the rmp
bitmap | bitmap describing which position data to reset, should not be greater than RESET_ALL_POSITION_DATA (0x0000001F) |
std::logic_error | if the bitmap is not valid. Please read the rmp manual for more information about bitmap validity. |
Definition at line 224 of file RmpInterface.cpp.
Reset all parameters stored in NVM to their default values
Definition at line 297 of file RmpInterface.cpp.
bool segway::RmpInterface::SendConfigurationCommand | ( | uint16_t | commandId, |
uint32_t | value | ||
) | [protected] |
Send configuration command
commandId | configuration command id, specified in RmpConfigurationCommand.h |
value | configuration value |
Definition at line 637 of file RmpInterface.cpp.
bool segway::RmpInterface::SetConfiguration | ( | const RmpConfigurationCommand< T > & | rConfigurationCommand, |
T | value | ||
) |
Execute configuration command
rConfigurationCommand | configuration command object as defined in RmpConfigurationCommand.h |
value | parameter value. This templated function is only implemented for type uint32_t and float. |
std::logic_error | if called with template parameter different than uint32_t or float |
Definition at line 105 of file RmpInterface.cpp.
bool segway::RmpInterface::SetConfiguration | ( | const RmpConfigurationCommand< uint32_t > & | rConfigurationCommand, |
uint32_t | value | ||
) |
Definition at line 113 of file RmpInterface.cpp.
bool segway::RmpInterface::SetConfiguration | ( | const RmpConfigurationCommand< float > & | rConfigurationCommand, |
float | value | ||
) |
Definition at line 131 of file RmpInterface.cpp.
bool segway::RmpInterface::SetConfiguration | ( | uint16_t | commandId, |
UserDefinedFeedbackType | feedbackType, | ||
uint32_t | value | ||
) | [protected] |
Set up configuration
commandId | configuration command id, specified in RmpConfigurationCommand.h |
feedbackType | user defined feeback type, specified in RmpUserdefinedFeedbackType |
value | configuration value |
Definition at line 581 of file RmpInterface.cpp.
bool segway::RmpInterface::SetUserDefinedFeedbackBitmap | ( | UserDefinedFeedbackBitmapType | bitmapType, |
const uint32_t | bitmap | ||
) |
Set user defined feedback bitmap
bitmapType | type of user defined feedback bitmap |
bitmap | feedback bitmap |
std::logic_error | if bitmapType is not valid |
std::logic_error | if bitmap is not valid. Please read the rmp manual for more information about bitmap validity. |
Definition at line 327 of file RmpInterface.cpp.
void segway::RmpInterface::ShutDown | ( | ) | [virtual] |
Stop the communication
Definition at line 95 of file RmpInterface.cpp.
bool segway::RmpInterface::Update | ( | bool | forceUpdate = false | ) | [virtual] |
Update Read and update the platform state
forceUpdate | force update. If true, will send a dummy command to cause a response. |
Definition at line 148 of file RmpInterface.cpp.
void segway::RmpInterface::UpdateUserDefinedFeedback | ( | const Bytes & | rBytes | ) | [protected] |
Update user defined feedback Convert a byte array to user defined feedback data.
rBytes | byte array |
Definition at line 662 of file RmpInterface.cpp.
uint32_t segway::RmpInterface::m_FeedbackBitmap[FEEDBACK_TYPE_NBR] [protected] |
Store the user defined feedback bitmap information
Definition at line 265 of file RmpInterface.h.
bool segway::RmpInterface::m_IsFeedbackBitmapSet [protected] |
Wether the user defined feedback bitmap is set (known)
Definition at line 260 of file RmpInterface.h.
RmpTransport::Ptr segway::RmpInterface::m_pTransport [protected] |
Transport interface
Definition at line 255 of file RmpInterface.h.
uint32_t segway::RmpInterface::m_UserDefinedFeedback[FEEDBACK_TYPE_NBR][MAX_ENTRIES_PER_FEEDBACK] [protected] |
Store the user defined feedback
Definition at line 270 of file RmpInterface.h.