LocalGuidance
A library that generates velocity references to follow a path.
local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling Class Reference

#include <LocoCtrlInfoLocoCrawling.hpp>

Inheritance diagram for local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling:
Inheritance graph

Public Types

using LocoCtrlInfoLocoCrawlingPtr = std::unique_ptr< LocoCtrlInfoLocoCrawling >
 
- Public Types inherited from local_guidance_loco_ctrl_manager::LocoCtrlInfoInterface
using LocomotionController = navigation_common::LocomotionControllerLocalGuidance
 
using LocoCtrlInfoInterfacePtr = std::unique_ptr< LocoCtrlInfoInterface >
 

Public Member Functions

 ~LocoCtrlInfoLocoCrawling () override=default
 
bool stop () override
 
bool activateMode () override
 
bool hasMode () const override
 
bool activateSubMode () override
 
bool hasSubMode () const override
 
bool requiresToTakeOverTwist () const override
 
- Public Member Functions inherited from local_guidance_loco_ctrl_manager::LocoCtrlInfoInterface
 LocoCtrlInfoInterface (ros::NodeHandle &nodeHandle, const LocomotionController &locomotionController)
 
virtual ~LocoCtrlInfoInterface ()=default
 
void getLocomotionController (LocomotionController *locomotionController) const
 
LocomotionController getLocomotionController () const
 
std::string getLocomotionControllerName () const
 
bool activateModeIfPresent ()
 
bool activateSubModeIfPresent ()
 

Static Public Member Functions

static LocoCtrlInfoLocoCrawlingPtr create (ros::NodeHandle &nodeHandle, const LocomotionController &locomotionController)
 

Private Member Functions

 LocoCtrlInfoLocoCrawling (ros::NodeHandle &nodeHandle, const LocomotionController &locomotionController)
 
bool init ()
 
bool goToMode (const std::string &requestedMode)
 
bool switchGait (const std::string &requestedGaitName)
 
bool getActiveMode (std::string *activeMode)
 
bool isCurrentModeWalk ()
 
bool isCurrentModeStand ()
 
int8_t sendSwitchGaitRequest (const std::string &requestedGaitName)
 
int8_t sendSwitchModeRequest (const std::string &requestedModeName)
 

Private Attributes

std::string standModeName_
 Name of the stand mode. More...
 
ros::ServiceClient goToModeClient_
 Go to mode service, client. More...
 
ros::ServiceClient getAvailableGaitsClient_
 Get available gaits service, client. More...
 
ros::ServiceClient switchGaitClient_
 Switch gaits service, client. More...
 
ros::ServiceClient getActiveModeClient_
 Get active mode service, client. More...
 
const ros::Duration timeOutNewAttemptSwitchToGait_
 Timeout to wait before trying for the second time to switch to another gait. More...
 
const ros::Duration timeOutNewAttemptSwitchMode_
 Timeout to wait before trying for the second time to switch mode. More...
 

Additional Inherited Members

- Protected Attributes inherited from local_guidance_loco_ctrl_manager::LocoCtrlInfoInterface
ros::NodeHandle & nodeHandle_
 Ros node handle. More...
 
const LocomotionController locomotionController_
 Locomotion controller info. More...
 

Member Typedef Documentation

Constructor & Destructor Documentation

local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::~LocoCtrlInfoLocoCrawling ( )
overridedefault

Destructor.

local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::LocoCtrlInfoLocoCrawling ( ros::NodeHandle &  nodeHandle,
const LocomotionController locomotionController 
)
explicitprivate

Clients can't invoke the constructor directly: use function create() instead

Parameters
[in]nodeHandleROS node handle.
[in]locomotionControllerlocomotion controller information.

Member Function Documentation

bool local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::activateMode ( )
overridevirtual

Activates the mode of the locomotion controller.

Returns
true in case of success.

Implements local_guidance_loco_ctrl_manager::LocoCtrlInfoInterface.

bool local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::activateSubMode ( )
overridevirtual

Activates the sub-mode of the locomotion controller.

Returns
true in case of success.

Implements local_guidance_loco_ctrl_manager::LocoCtrlInfoInterface.

static LocoCtrlInfoLocoCrawlingPtr local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::create ( ros::NodeHandle &  nodeHandle,
const LocomotionController locomotionController 
)
static

Factory function to be used to create and initialize an object of type LocoCtrlInfoLocoCrawling.

Parameters
[in]nodeHandleROS node handle.
[in]locomotionControllerlocomotion controller information.
Returns
nullptr in case of error, an actual object otherwise.
bool local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::getActiveMode ( std::string *  activeMode)
private

Returns active mode.

Parameters
[out]activeModeactive mode.
Returns
true in case of success.
bool local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::goToMode ( const std::string &  requestedMode)
private

Tries to switch to specified mode.

Parameters
[in]requestedModerequested mode.
Returns
true in case of success.
bool local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::hasMode ( ) const
overridevirtual

Tells if the locomotion controller has a mode that could be activated by activateMode().

Returns

Implements local_guidance_loco_ctrl_manager::LocoCtrlInfoInterface.

bool local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::hasSubMode ( ) const
overridevirtual

Tells if the locomotion controller has a sub-mode that could be activated by activateSubMode().

Returns

Implements local_guidance_loco_ctrl_manager::LocoCtrlInfoInterface.

bool local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::init ( )
private

Initializes the object and reads parameters from yaml file.

Returns
true in case of success.
bool local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::isCurrentModeStand ( )
private

Tells if the current mode is stand.

Returns
true if mode is stand.
bool local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::isCurrentModeWalk ( )
private

Tells if the current mode is walk.

Returns
true if mode is walk.
bool local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::requiresToTakeOverTwist ( ) const
overridevirtual

Tells if the locomotion controller needs to take over the twist, i.e. it accepts velocity commands.

Returns

Implements local_guidance_loco_ctrl_manager::LocoCtrlInfoInterface.

int8_t local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::sendSwitchGaitRequest ( const std::string &  requestedGaitName)
private

Tries to call switch gait server.

Parameters
requestedGaitNamename of requested gait.
Returns
return of the server.
int8_t local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::sendSwitchModeRequest ( const std::string &  requestedModeName)
private

Tries to call switch mode server.

Parameters
requestedModeNamename of requested mode.
Returns
return of the server.
bool local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::stop ( )
overridevirtual

Stops locomotion controller.

Returns
true in case of success.

Implements local_guidance_loco_ctrl_manager::LocoCtrlInfoInterface.

bool local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::switchGait ( const std::string &  requestedGaitName)
private

Tries to switch to a requested gait.

Parameters
requestedGaitNamename of requested gait.
Returns
true in case of success.

Member Data Documentation

ros::ServiceClient local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::getActiveModeClient_
private

Get active mode service, client.

ros::ServiceClient local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::getAvailableGaitsClient_
private

Get available gaits service, client.

ros::ServiceClient local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::goToModeClient_
private

Go to mode service, client.

std::string local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::standModeName_
private

Name of the stand mode.

ros::ServiceClient local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::switchGaitClient_
private

Switch gaits service, client.

const ros::Duration local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::timeOutNewAttemptSwitchMode_
private

Timeout to wait before trying for the second time to switch mode.

const ros::Duration local_guidance_loco_ctrl_manager::LocoCtrlInfoLocoCrawling::timeOutNewAttemptSwitchToGait_
private

Timeout to wait before trying for the second time to switch to another gait.


The documentation for this class was generated from the following file: