mars
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
mars::Sonar Class Reference

#include <Sonar.hpp>

Inheritance diagram for mars::Sonar:

Public Member Functions

 Sonar (std::string const &name="mars::Sonar")
 
 Sonar (std::string const &name, RTT::ExecutionEngine *engine)
 
double getSonarBeamBearing (unsigned long sonar_mounting_id)
 
void updateTopSonarPosition ()
 
bool getSonarData (base::samples::SonarBeam &sonar_beam)
 The following lines are template definitions for the various state machine. More...
 
virtual bool setLeft_limit (double value)
 
virtual bool setMaximum_distance (double value)
 
virtual bool setPing_pong_mode (bool value)
 
virtual bool setResolution (double value)
 
virtual bool setRight_limit (double value)
 
 ~Sonar ()
 
bool startHook ()
 
void updateHook ()
 

Protected Member Functions

void update (double time)
 

Protected Attributes

base::samples::SonarBeam sonar_beam
 
unsigned long node_id
 
mars::SonarConfigsonar_config
 
int sonar_motor_direction
 
pthread_mutex_t * sonar_update_mutex
 

Friends

class SonarBase
 

Constructor & Destructor Documentation

◆ Sonar() [1/2]

Sonar::Sonar ( std::string const &  name = "mars::Sonar")

◆ Sonar() [2/2]

Sonar::Sonar ( std::string const &  name,
RTT::ExecutionEngine *  engine 
)

◆ ~Sonar()

Sonar::~Sonar ( )

Member Function Documentation

◆ getSonarBeamBearing()

double mars::Sonar::getSonarBeamBearing ( unsigned long  sonar_mounting_id)

◆ getSonarData()

bool Sonar::getSonarData ( base::samples::SonarBeam &  sonar_beam)

The following lines are template definitions for the various state machine.

◆ setLeft_limit()

bool Sonar::setLeft_limit ( double  value)
virtual

◆ setMaximum_distance()

bool Sonar::setMaximum_distance ( double  value)
virtual

◆ setPing_pong_mode()

bool Sonar::setPing_pong_mode ( bool  value)
virtual

◆ setResolution()

bool Sonar::setResolution ( double  value)
virtual

◆ setRight_limit()

bool Sonar::setRight_limit ( double  value)
virtual

◆ startHook()

bool Sonar::startHook ( )

This hook is called by Orocos when the state machine transitions from PreOperational to Stopped. If it returns false, then the component will stay in PreOperational. Otherwise, it goes into Stopped.

It is meaningful only if the #needs_configuration has been specified in the task context definition with (for example):

task_context "TaskName" do needs_configuration ... end This hook is called by Orocos when the state machine transitions from Stopped to Running. If it returns false, then the component will stay in Stopped. Otherwise, it goes into Running and updateHook() will be called.

◆ update()

void Sonar::update ( double  time)
protected

◆ updateHook()

void Sonar::updateHook ( )

This hook is called by Orocos when the component is in the Running state, at each activity step. Here, the activity gives the "ticks" when the hook should be called.

The error(), exception() and fatal() calls, when called in this hook, allow to get into the associated RunTimeError, Exception and FatalError states.

In the first case, updateHook() is still called, and recover() allows you to go back into the Running state. In the second case, the errorHook() will be called instead of updateHook(). In Exception, the component is stopped and recover() needs to be called before starting it again. Finally, FatalError cannot be recovered.

◆ updateTopSonarPosition()

void mars::Sonar::updateTopSonarPosition ( )

Friends And Related Function Documentation

◆ SonarBase

friend class SonarBase
friend

Member Data Documentation

◆ node_id

unsigned long mars::Sonar::node_id
protected

◆ sonar_beam

base::samples::SonarBeam mars::Sonar::sonar_beam
protected

◆ sonar_config

mars::SonarConfig* mars::Sonar::sonar_config
protected

◆ sonar_motor_direction

int mars::Sonar::sonar_motor_direction
protected

◆ sonar_update_mutex

pthread_mutex_t* mars::Sonar::sonar_update_mutex
protected

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