Skip to content
Snippets Groups Projects
Commit da720dcd authored by jcarpent's avatar jcarpent
Browse files

[Doc] Add documentation of Frame struct

parent 28bf9c28
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,7 @@ namespace se3
void visit(PyClass& cl) const
{
cl
.def(bp::init<const std::string&,Index, const SE3_fx&> ((bp::arg("name"),bp::arg("parent id"), bp::arg("placement")),
.def(bp::init<const std::string&,const Index, const SE3_fx&> ((bp::arg("name (string)"),bp::arg("parent_id (index)"), bp::arg("SE3 placement")),
"Initialize from name, parent id and placement wrt parent joint."))
.add_property("name", &FramePythonVisitor::getName, &FramePythonVisitor::setName)
......@@ -69,7 +69,7 @@ namespace se3
static void expose()
{
bp::class_<Frame>("Frame",
"ExtraFrames.\n\n",
"A Plucker coordinate frame related to a parent joint inside a kinematic tree.\n\n",
bp::no_init
)
.def(FramePythonVisitor())
......
......@@ -27,32 +27,52 @@
namespace se3
{
struct Frame
{
typedef std::size_t Index;
Frame() : name(random(8)), parent_id(), frame_placement()
///
/// \brief What is a frame? TODO: complete this description.
///
struct Frame
{
typedef std::size_t Index;
Frame() : name(random(8)), parent_id(), framePlacement() {} // needed by EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION
///
/// \brief Default constructor of a Frame
///
/// \param[in] name Name of the frame.
/// \param[in] parent_id Index of the parent joint in the kinematic tree.
/// \param[in] frame_placement Placement of the frame wrt the parent joint frame.
///
Frame(const std::string & name, const Index parent_id, const SE3 & frame_placement):
name(name)
, parent_id(parent_id)
, framePlacement(frame_placement)
{}
///
/// \brief Compare the current Frame with another frame. Return true if all properties match.
///
/// \param[in] other The frame to which the current frame is compared.
///
bool operator == (const Frame & other) const
{
return name == other.name && parent_id == other.parent_id
&& framePlacement == other.framePlacement ;
}
/// \brief Name of the frame.
std::string name;
/// \brief Index of the parent joint.
Index parent_id;
/// \brief Placement of the frame wrt the parent joint.
SE3 framePlacement;
}; // struct Frame
}
Frame(const std::string & name, Index parent, const SE3 & placement): name(name)
, parent_id(parent)
, frame_placement(placement)
{
}
bool operator == (const Frame & other) const
{
return name == other.name && parent_id == other.parent_id
&& frame_placement == other.frame_placement ;
}
} // namespace se3
std::string name;
Index parent_id;
SE3 frame_placement;
};
EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(se3::Frame)
}
#endif // ifndef __se3_frame_hpp__
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment