Fawkes API  Fawkes Development Version
PlayerMotorPositionMapper Class Reference

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

#include "motor_mapper.h"

Inheritance diagram for PlayerMotorPositionMapper:

List of all members.

Public Member Functions

 PlayerMotorPositionMapper (std::string varname, fawkes::MotorInterface *interface, PlayerCc::Position2dProxy *proxy)
 Constructor.
virtual void sync_fawkes_to_player ()
 Sync Fawkes interface to Player proxy.
virtual void sync_player_to_fawkes ()
 Sync Player proxy to Fawkes interface.

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

Constructor & Destructor Documentation

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

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::Interface::msgq_empty(), fawkes::Interface::msgq_first_is(), fawkes::Interface::msgq_first(), fawkes::MotorInterface::SetMotorStateMessage::motor_state(), fawkes::MotorInterface::GotoMessage::x(), fawkes::MotorInterface::GotoMessage::y(), fawkes::MotorInterface::GotoMessage::phi(), and fawkes::Interface::msgq_pop().

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_position_x(), fawkes::MotorInterface::set_odometry_position_y(), fawkes::MotorInterface::set_odometry_orientation(), and fawkes::Interface::write().


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