se2ez
se2ez::Scene Class Reference

A representation of a Scene (in this case, one active robot and multiple passive robots (with all joints fixed representing the obstacles). More...

#include <scene.h>

Classes

struct  RobotData
 

Public Member Functions

 Scene (const RobotPtr &arobot)
 Constructor. Nothing interesting right now. More...
 
 Scene (const Scene &)=delete
 
 Scene (Scene &&)=delete
 
Scene Management
void addRobot (const RobotPtr &robot, const std::string &name)
 Attach a robot as passive to the scene at a zero state. More...
 
void addRobot (const RobotPtr &robot, const std::string &name, const StatePtr &state)
 Attach a robot as passive to the scene with given state. More...
 
void compileScene ()
 creates the scene, is called after a robot is added. More...
 
void removeRobot (const std::string &name)
 Removes the specific robot from the Scene. More...
 
void clear ()
 Completely clears internal structures, a brand new scene! More...
 
void clearPassive ()
 Completely clears the passive robots! More...
 
Getters and Setters
const RobotPtrgetActiveRobot ()
 Returns a the active robot. More...
 
const RobotPtrgetSceneRobot ()
 Returns a new aggregated robot including all the passive and active robots. More...
 
const std::stringgetSignature ()
 Returns the mrobot signature. More...
 
const RobotPtrgetRobot (const std::string &name)
 Returns robot the robot named name, throws error otherwise. More...
 
const std::vector< std::stringgetRobotNames ()
 Gets the all the names of the robots active and passive. More...
 
void setRobotState (const std::string &name, const StatePtr &state)
 Sets a state for a robot. More...
 
void setRandom ()
 Sets every passive robot to a random state. More...
 
void getNamedRobot (const std::string &name, const StatePtr &state)
 get the state for a robot. More...
 

Public Attributes

bool dirty {false}
 Does the scene robot need updating? More...
 

Private Attributes

std::map< std::string, RobotDatarobots_
 Map of robots and their names. More...
 
const RobotPtr arobot_
 Active Robot. More...
 
RobotPtr mrobot_
 Mega Robot. More...
 

Detailed Description

A representation of a Scene (in this case, one active robot and multiple passive robots (with all joints fixed representing the obstacles).

Definition at line 32 of file scene.h.

Constructor & Destructor Documentation

◆ Scene() [1/3]

Scene::Scene ( const RobotPtr arobot)

Constructor. Nothing interesting right now.

Definition at line 22 of file scene.cpp.

◆ Scene() [2/3]

se2ez::Scene::Scene ( const Scene )
delete

◆ Scene() [3/3]

se2ez::Scene::Scene ( Scene &&  )
delete

Member Function Documentation

◆ addRobot() [1/2]

void Scene::addRobot ( const RobotPtr robot,
const std::string name 
)

Attach a robot as passive to the scene at a zero state.

Parameters
[in]robotRobot to attach.
[in]nameName of the robot.

Frame / Kinematic Tree Updating

Definition at line 32 of file scene.cpp.

◆ addRobot() [2/2]

void Scene::addRobot ( const RobotPtr robot,
const std::string name,
const StatePtr state 
)

Attach a robot as passive to the scene with given state.

Parameters
[in]robotRobot to attach.
[in]nameName of the robot.
[in]stateState of the attached Frame.

Definition at line 38 of file scene.cpp.

◆ clear()

void Scene::clear ( )

Completely clears internal structures, a brand new scene!

Definition at line 79 of file scene.cpp.

◆ clearPassive()

void se2ez::Scene::clearPassive ( )

Completely clears the passive robots!

◆ compileScene()

void Scene::compileScene ( )

creates the scene, is called after a robot is added.

Definition at line 49 of file scene.cpp.

◆ getActiveRobot()

const RobotPtr & Scene::getActiveRobot ( )

Returns a the active robot.

Returns
Active Robot.

Definition at line 85 of file scene.cpp.

◆ getNamedRobot()

void se2ez::Scene::getNamedRobot ( const std::string name,
const StatePtr state 
)

get the state for a robot.

Parameters
[in]nameName of state to set.
[in]stateState to set named state to.

◆ getRobot()

const RobotPtr & Scene::getRobot ( const std::string name)

Returns robot the robot named name, throws error otherwise.

Returns
RobotPtr to that robot.

Definition at line 106 of file scene.cpp.

◆ getRobotNames()

const std::vector< std::string > Scene::getRobotNames ( )

Gets the all the names of the robots active and passive.

Returns
Vector of all robots in the Scene.

Definition at line 115 of file scene.cpp.

◆ getSceneRobot()

const RobotPtr & Scene::getSceneRobot ( )

Returns a new aggregated robot including all the passive and active robots.

Returns
MegaRobot.

Definition at line 90 of file scene.cpp.

◆ getSignature()

const std::string & Scene::getSignature ( )

Returns the mrobot signature.

Returns
signature of the mega-robot.

Definition at line 101 of file scene.cpp.

◆ removeRobot()

void Scene::removeRobot ( const std::string name)

Removes the specific robot from the Scene.

Definition at line 69 of file scene.cpp.

◆ setRandom()

void Scene::setRandom ( )

Sets every passive robot to a random state.

Definition at line 124 of file scene.cpp.

◆ setRobotState()

void se2ez::Scene::setRobotState ( const std::string name,
const StatePtr state 
)

Sets a state for a robot.

Parameters
[in]nameName of state to set.
[in]stateState to set named state to.

Member Data Documentation

◆ arobot_

const RobotPtr se2ez::Scene::arobot_
private

Active Robot.

Definition at line 139 of file scene.h.

◆ dirty

bool se2ez::Scene::dirty {false}

Does the scene robot need updating?

Definition at line 135 of file scene.h.

◆ mrobot_

RobotPtr se2ez::Scene::mrobot_
private

Mega Robot.

Definition at line 140 of file scene.h.

◆ robots_

std::map<std::string, RobotData> se2ez::Scene::robots_
private

Map of robots and their names.

Definition at line 138 of file scene.h.


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