Object configuration information. More...
#include <Object.h>
Public Member Functions | |
void | addAlias (const std::string &alias) |
Alias adder. | |
bool | checkName (const std::string &name) const |
Name check. | |
geometry::Position | fromParentFrame (const geometry::Position &position) const |
Position transform. | |
geometry::Pose | fromParentFrame (const geometry::Pose &pose) const |
Pose transform. | |
const std::string & | getAlias (const size_t index) const |
Alias value accessor. | |
const std::vector< std::string > & | getAliases () const |
Aliases value accessor. | |
double | getDepth () const |
Depth value accessor. | |
const std::string & | getFrameID () const |
Frame ID value accessor. | |
double | getHeight () const |
Height value accessor. | |
const std::string & | getName () const |
Name value accessor. | |
size_t | getNumAliases () const |
Aliases size accessor. | |
const geometry::Pose & | getPose () const |
Pose value accessor (immutable). | |
geometry::Pose & | getPose () |
Pose value accessor. | |
double | getWidth () const |
Width value accessor. | |
Object (const std::string &name="", const std::string &frame_id="", const geometry::Pose &pose=geometry::Pose(), const double width=0, const double depth=0, const double height=0) | |
Create a new Object. | |
void | removeAlias (const size_t index) |
Alias remover. | |
void | setDepth (const double depth) |
Depth value mutator. | |
void | setFrameID (const std::string &frame_id) |
Frame ID value mutator. | |
void | setHeight (const double height) |
Height value mutator. | |
void | setName (const std::string &name) |
Name value mutator. | |
void | setPose (geometry::Pose &pose) |
Pose value mutator. | |
void | setWidth (const double width) |
Width value mutator. | |
Private Attributes | |
std::vector< std::string > | aliases_ |
double | depth_ |
std::string | frame_id_ |
double | height_ |
std::string | name_ |
geometry::Pose | pose_ |
double | width_ |
Object configuration information.
An object is an abstract entity in the world. Objects can be mutable entities (e.g., manipulable items) or immutable entities (e.g., surfaces and furniture). Objects can have an array of associated aliases associated with their main name.
Object::Object | ( | const std::string & | name = "" , |
const std::string & | frame_id = "" , |
||
const geometry::Pose & | pose = geometry::Pose() , |
||
const double | width = 0 , |
||
const double | depth = 0 , |
||
const double | height = 0 |
||
) |
Create a new Object.
Create a new Object with the given name, frame ID, Pose (in reference to the parent's frame ID), and dimensions.
name | The name of the Object (defaults to the empty string). |
frame_id | The frame ID of the Object (defaults to the empty string). |
pose | The Pose of the Object with respect to the parent frame (defaults to 0 Pose). |
width | The width of the Object (along the x-axis) (defaults to 0). |
depth | The width of the Object (along the y-axis) (defaults to 0). |
height | The height of the Object (along the z-axis) (defaults to 0). |
Definition at line 23 of file Object.cpp.
void Object::addAlias | ( | const std::string & | alias | ) |
Alias adder.
Add the alias to this Object.
alias | The new alias to add to this Object. |
Definition at line 118 of file Object.cpp.
bool Object::checkName | ( | const std::string & | name | ) | const |
Name check.
Check if this object goes by the given name by checking both the default name and aliases. Case is not important.
name | The name to check, |
Definition at line 135 of file Object.cpp.
Position Object::fromParentFrame | ( | const geometry::Position & | position | ) | const |
Position transform.
Transform the given Position from the parent's frame to this Object's frame. For example, the parent of a Surface is a Room. Passing in a Position in the Room frame will return that Position in the Surface frame.
position | The Position to transform, |
Definition at line 159 of file Object.cpp.
Pose Object::fromParentFrame | ( | const geometry::Pose & | pose | ) | const |
Pose transform.
Transform the given Pose from the parent's frame to this Object's frame. For example, the parent of a Surface is a Room. Passing in a Pose in the Room frame will return that Pose in the Surface frame.
pose | The Pose to transform, |
Definition at line 167 of file Object.cpp.
const string & Object::getAlias | ( | const size_t | index | ) | const |
Alias value accessor.
Get the alias of this Object at the given index.
i | The index of the alias to get. |
std::out_of_range | Thrown if the alias at the given index does not exist. |
Definition at line 106 of file Object.cpp.
const vector< string > & Object::getAliases | ( | ) | const |
Aliases value accessor.
Get the aliases of this Object.
Definition at line 96 of file Object.cpp.
double Object::getDepth | ( | ) | const |
Depth value accessor.
Get the depth value of this Object.
Definition at line 76 of file Object.cpp.
const string & Object::getFrameID | ( | ) | const |
Frame ID value accessor.
Get the frame ID value of this Object.
Definition at line 41 of file Object.cpp.
double Object::getHeight | ( | ) | const |
Height value accessor.
Get the height value of this Object.
Definition at line 86 of file Object.cpp.
const string & Object::getName | ( | ) | const |
Name value accessor.
Get the name value of this Object.
Definition at line 31 of file Object.cpp.
size_t Object::getNumAliases | ( | ) | const |
Aliases size accessor.
Get the number of aliases of this Object.
Definition at line 101 of file Object.cpp.
const Pose & Object::getPose | ( | ) | const |
Pose value accessor (immutable).
Get the Pose value of this Object (with respect to its parents frame).
Definition at line 51 of file Object.cpp.
Pose & Object::getPose | ( | ) |
Pose value accessor.
Get the Pose value of this Object (with respect to its parents frame).
Definition at line 56 of file Object.cpp.
double Object::getWidth | ( | ) | const |
Width value accessor.
Get the width value of this Object.
Definition at line 66 of file Object.cpp.
void Object::removeAlias | ( | const size_t | index | ) |
Alias remover.
Remove the alias at the given index. An invalid index results in no effect.
i | The index of the alias to remove. |
std::out_of_range | Thrown if the alias at the given index does not exist. |
Definition at line 123 of file Object.cpp.
void Object::setDepth | ( | const double | depth | ) |
Depth value mutator.
Set the depth value of this Object.
depth | The new depth value of this Object. |
Definition at line 81 of file Object.cpp.
void Object::setFrameID | ( | const std::string & | frame_id | ) |
Frame ID value mutator.
Set the frame ID value of this Object.
frame_id | The new frame ID value of this Object. |
Definition at line 46 of file Object.cpp.
void Object::setHeight | ( | const double | height | ) |
Height value mutator.
Set the height value of this Object.
height | The new height value of this Object. |
Definition at line 91 of file Object.cpp.
void Object::setName | ( | const std::string & | name | ) |
Name value mutator.
Set the name value of this Object.
name | The new name value of this Object. |
Definition at line 36 of file Object.cpp.
void Object::setPose | ( | geometry::Pose & | pose | ) |
Pose value mutator.
Set the Pose value of this Object.
pose | The new Pose value of this Object. |
Definition at line 61 of file Object.cpp.
void Object::setWidth | ( | const double | width | ) |
Width value mutator.
Set the width value of this Object.
width | The new width value of this Object. |
Definition at line 71 of file Object.cpp.
std::vector<std::string> rail::spatial_temporal_learning::worldlib::world::Object::aliases_ [private] |
double rail::spatial_temporal_learning::worldlib::world::Object::depth_ [private] |
std::string rail::spatial_temporal_learning::worldlib::world::Object::frame_id_ [private] |
double rail::spatial_temporal_learning::worldlib::world::Object::height_ [private] |
std::string rail::spatial_temporal_learning::worldlib::world::Object::name_ [private] |
double rail::spatial_temporal_learning::worldlib::world::Object::width_ [private] |