Fawkes API  Fawkes Development Version
PlayerMotorPositionMapper Class Reference

Motor to position mapper for player integration. More...

#include "motor_mapper.h"

Inheritance diagram for PlayerMotorPositionMapper:

Public Member Functions

 PlayerMotorPositionMapper (std::string varname, fawkes::MotorInterface *interface, PlayerCc::Position2dProxy *proxy)
 Constructor. More...
 
virtual void sync_fawkes_to_player ()
 Sync Fawkes interface to Player proxy. More...
 
virtual void sync_player_to_fawkes ()
 Sync Player proxy to Fawkes interface. More...
 
- Public Member Functions inherited from PlayerProxyFawkesInterfaceMapper
 PlayerProxyFawkesInterfaceMapper (std::string varname)
 Constructor. More...
 
virtual ~PlayerProxyFawkesInterfaceMapper ()
 Virtual empty destructor. More...
 
std::string varname () const
 Get variable name. More...
 

Detailed Description

Motor to position mapper for player integration.

This class is used to map a Player position2d proxy to a Fawkes MotorInterface.

It maps

  • MotorInterface::GotoMessage to Position2dProxy::GoTo()
  • MotorInterface::SetMotorStateMessage to Position2dProxy::SetMotorEnable()
  • MotorInterface::ResetOdometryMessage to Position2dProxy::ResetOdometry()
Author
Tim Niemueller

Definition at line 36 of file motor_mapper.h.

Constructor & Destructor Documentation

◆ PlayerMotorPositionMapper()

PlayerMotorPositionMapper::PlayerMotorPositionMapper ( std::string  varname,
fawkes::MotorInterface interface,
PlayerCc::Position2dProxy *  proxy 
)

Constructor.

Parameters
varnamevariable name
interfaceFawkes interface instance
proxyPlayer proxy instance

Definition at line 50 of file motor_mapper.cpp.

Member Function Documentation

◆ sync_fawkes_to_player()

void PlayerMotorPositionMapper::sync_fawkes_to_player ( )
virtual

Sync Fawkes interface to Player proxy.

This method should be implemented to copy any outstanding data from the Fawkes interface (messages) to the Player interface. This method will be called in the ACT_EXEC hook of the BlockedTimingAspect (cf. MainLoop).

Implements PlayerProxyFawkesInterfaceMapper.

Definition at line 75 of file motor_mapper.cpp.

References fawkes::MotorInterface::SetMotorStateMessage::motor_state(), fawkes::Interface::msgq_empty(), fawkes::Interface::msgq_first(), fawkes::Interface::msgq_first_is(), fawkes::Interface::msgq_pop(), fawkes::MotorInterface::GotoMessage::phi(), fawkes::MotorInterface::GotoMessage::x(), and fawkes::MotorInterface::GotoMessage::y().

◆ sync_player_to_fawkes()

void PlayerMotorPositionMapper::sync_player_to_fawkes ( )
virtual

Sync Player proxy to Fawkes interface.

This method should be implemented to copy any outstanding data from the Player proxy to the Fawkes interface. This method will be called in the ACT_EXEC hook of the BlockedTimingAspect (cf. MainLoop).

Implements PlayerProxyFawkesInterfaceMapper.

Definition at line 61 of file motor_mapper.cpp.

References fawkes::MotorInterface::set_odometry_orientation(), fawkes::MotorInterface::set_odometry_position_x(), fawkes::MotorInterface::set_odometry_position_y(), and fawkes::Interface::write().


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