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

#include <Task.hpp>

Inheritance diagram for mars::Task:

Public Member Functions

 Task (std::string const &name="mars::Task")
 
 Task (std::string const &name, RTT::ExecutionEngine *engine)
 
 ~Task ()
 
void registerPlugin (Plugin *plugin)
 
void unregisterPlugin (Plugin *plugin)
 
bool configureHook ()
 
bool startHook ()
 
void updateHook ()
 
void errorHook ()
 
void stopHook ()
 
void cleanupHook ()
 
void receiveData (const mars::data_broker::DataInfo &info, const mars::data_broker::DataPackage &package, int id)
 

Static Public Member Functions

static mars::interfaces::SimulatorInterface * getSimulatorInterface ()
 
static mars::TaskgetTaskInterface ()
 

Protected Member Functions

int getOptionCount (const std::vector< Option > &options)
 
virtual void move_node (::mars::Positions const &arg)
 
char ** setOptions (const std::vector< Option > &options)
 
virtual void loadScene (::std::string const &path)
 
virtual bool setShow_coordinate_system (bool value)
 
virtual bool setReaction_to_physics_error (::std::string const &value)
 
virtual bool setSim_step_size (double value)
 
virtual bool setGravity (::base::Vector3d const &value)
 
virtual bool setGravity_internal (::base::Vector3d const &value)
 
virtual void setPosition (::mars::Positions const &positions)
 

Static Protected Member Functions

static void * startTaskFunc (void *)
 

Protected Attributes

QApplication * app
 
pthread_t thread_info
 
mars::interfaces::PluginInterface * multisimPlugin
 
std::vector< Plugin * > plugins
 
mars::interfaces::GraphicsManagerInterface * marsGraphics
 

Static Protected Attributes

static mars::app::GraphicsTimer * graphicsTimer = 0
 
static mars::interfaces::SimulatorInterface * simulatorInterface = 0
 
static mars::TasktaskInterface = 0
 
static std::string configDir
 
static bool marsRunning
 
static lib_manager::LibManager * libManager = 0
 

Friends

class TaskBase
 

Detailed Description

Core module that brings up the mars mars and makes it accessible as a orogen module

use subclassing to derive robot specific modules, e.g.

task_context 'RobotSimulation' do subclasses 'mars::Task' .. end

Constructor & Destructor Documentation

◆ Task() [1/2]

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

◆ Task() [2/2]

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

◆ ~Task()

Task::~Task ( )

Member Function Documentation

◆ cleanupHook()

void Task::cleanupHook ( )

This hook is called by Orocos when the state machine transitions from Stopped to PreOperational, requiring the call to configureHook() before calling start() again.

◆ configureHook()

bool Task::configureHook ( )

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

◆ errorHook()

void Task::errorHook ( )

This hook is called by Orocos when the component is in the RunTimeError state, at each activity step. See the discussion in updateHook() about triggering options.

Call recovered() to go back in the Runtime state.

◆ getOptionCount()

int Task::getOptionCount ( const std::vector< Option > &  options)
protected

◆ getSimulatorInterface()

mars::interfaces::SimulatorInterface * Task::getSimulatorInterface ( )
static

get the singleton instance of the simulator interface

◆ getTaskInterface()

mars::Task * Task::getTaskInterface ( )
static

◆ loadScene()

void Task::loadScene ( ::std::string const &  path)
protectedvirtual

◆ move_node()

void Task::move_node ( ::mars::Positions const &  arg)
protectedvirtual

◆ receiveData()

void Task::receiveData ( const mars::data_broker::DataInfo &  info,
const mars::data_broker::DataPackage &  package,
int  id 
)

◆ registerPlugin()

void Task::registerPlugin ( Plugin plugin)

◆ setGravity()

bool Task::setGravity ( ::base::Vector3d const &  value)
protectedvirtual

◆ setGravity_internal()

bool Task::setGravity_internal ( ::base::Vector3d const &  value)
protectedvirtual

◆ setOptions()

char ** Task::setOptions ( const std::vector< Option > &  options)
protected

◆ setPosition()

void Task::setPosition ( ::mars::Positions const &  positions)
protectedvirtual

◆ setReaction_to_physics_error()

bool Task::setReaction_to_physics_error ( ::std::string const &  value)
protectedvirtual

◆ setShow_coordinate_system()

bool Task::setShow_coordinate_system ( bool  value)
protectedvirtual

◆ setSim_step_size()

bool Task::setSim_step_size ( double  value)
protectedvirtual

◆ startHook()

bool Task::startHook ( )

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.

◆ startTaskFunc()

void * Task::startTaskFunc ( void *  argument)
staticprotected

◆ stopHook()

void Task::stopHook ( )

This hook is called by Orocos when the state machine transitions from Running to Stopped after stop() has been called.

◆ unregisterPlugin()

void Task::unregisterPlugin ( Plugin plugin)

◆ updateHook()

void Task::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. See README.txt for different triggering options.

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

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

Friends And Related Function Documentation

◆ TaskBase

friend class TaskBase
friend

Member Data Documentation

◆ app

QApplication* mars::Task::app
protected

◆ configDir

std::string mars::Task::configDir
staticprotected

◆ graphicsTimer

mars::app::GraphicsTimer * Task::graphicsTimer = 0
staticprotected

◆ libManager

lib_manager::LibManager * Task::libManager = 0
staticprotected

◆ marsGraphics

mars::interfaces::GraphicsManagerInterface* mars::Task::marsGraphics
protected

◆ marsRunning

bool mars::Task::marsRunning
staticprotected

◆ multisimPlugin

mars::interfaces::PluginInterface* mars::Task::multisimPlugin
protected

◆ plugins

std::vector<Plugin*> mars::Task::plugins
protected

◆ simulatorInterface

mars::interfaces::SimulatorInterface * Task::simulatorInterface = 0
staticprotected

◆ taskInterface

mars::Task * Task::taskInterface = 0
staticprotected

◆ thread_info

pthread_t mars::Task::thread_info
protected

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