Commit a154de8a authored by Valenza Florian's avatar Valenza Florian
Browse files

[C++] Renamed member in Frame class

parent c68e5bfa
......@@ -82,8 +82,8 @@ namespace se3
{
for (Model::FrameIndex i=0; i < (Model::FrameIndex) model.nOperationalFrames; ++i)
{
const Model::JointIndex & parent = model.operational_frames[i].parent_id;
data.oMof[i] = (data.oMi[parent] * model.operational_frames[i].framePlacement);
const Model::JointIndex & parent = model.operational_frames[i].parent;
data.oMof[i] = (data.oMi[parent] * model.operational_frames[i].placement);
}
}
......@@ -107,14 +107,14 @@ namespace se3
assert( J.rows() == data.J.rows() );
assert( J.cols() == data.J.cols() );
const Model::JointIndex & parent = model.operational_frames[frame_id].parent_id;
const Model::JointIndex & parent = model.operational_frames[frame_id].parent;
const SE3 & oMframe = data.oMof[frame_id];
const Frame & frame = model.operational_frames[frame_id];
const int colRef = nv(model.joints[parent])+idx_v(model.joints[parent])-1;
// Lever between the joint center and the frame center expressed in the global frame
const SE3::Vector3 lever(data.oMi[parent].rotation() * (frame.framePlacement.translation()));
const SE3::Vector3 lever(data.oMi[parent].rotation() * (frame.placement.translation()));
getJacobian<localFrame>(model, data, parent, J);
for(int j=colRef;j>=0;j=data.parents_fromRow[(size_t) j])
......
......@@ -208,7 +208,7 @@ namespace se3
inline Model::JointIndex Model::getFrameParent( const FrameIndex index ) const
{
return operational_frames[index].parent_id;
return operational_frames[index].parent;
}
inline const SE3 & Model::getFramePlacement( const std::string & name) const
......@@ -225,7 +225,7 @@ namespace se3
inline const SE3 & Model::getFramePlacement( const FrameIndex index ) const
{
return operational_frames[index].framePlacement;
return operational_frames[index].placement;
}
inline bool Model::addFrame ( const Frame & frame )
......
......@@ -51,22 +51,21 @@ namespace se3
void visit(PyClass& cl) const
{
cl
.def(bp::init<const std::string&,const JointIndex, const SE3_fx&> ((bp::arg("name (string)"),bp::arg("parent_id (index)"), bp::arg("SE3 placement")),
.def(bp::init<const std::string&,const JointIndex, const SE3_fx&> ((bp::arg("name (string)"),bp::arg("parent (index)"), bp::arg("SE3 placement")),
"Initialize from name, parent id and placement wrt parent joint."))
.add_property("name", &FramePythonVisitor::getName, &FramePythonVisitor::setName)
.add_property("parent_id", &FramePythonVisitor::getParentId, &FramePythonVisitor::setParentId)
.add_property("framePlacement", &FramePythonVisitor::getPlacementWrtParentJoint, &FramePythonVisitor::setPlacementWrtParentJoint)
.def_readwrite("name", &Frame::name, "name of the frame")
.def_readwrite("parent", &Frame::parent, "id of the parent joint")
.add_property("placement",
&FramePythonVisitor::getPlacementWrtParentJoint,
&FramePythonVisitor::setPlacementWrtParentJoint,
"placement in the parent joint local frame")
;
}
static std::string getName( const Frame & self) { return self.name; }
static void setName(Frame & self, const std::string & name) { self.name = name; }
static JointIndex getParentId( const Frame & self) { return self.parent_id; }
static void setParentId(Frame & self, const JointIndex parent_id) { self.parent_id = parent_id; }
static SE3_fx getPlacementWrtParentJoint( const Frame & self) { return self.framePlacement; }
static void setPlacementWrtParentJoint(Frame & self, const SE3_fx & placement) { self.framePlacement = placement; }
static SE3_fx getPlacementWrtParentJoint( const Frame & self) { return self.placement; }
static void setPlacementWrtParentJoint(Frame & self, const SE3_fx & placement) { self.placement = placement; }
static void expose()
{
......
......@@ -36,19 +36,19 @@ namespace se3
{
typedef se3::JointIndex JointIndex;
Frame() : name(random(8)), parent_id(), framePlacement() {} // needed by EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION
Frame() : name(random(8)), parent(), placement() {} // 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.
/// \param[in] parent Index of the parent joint in the kinematic tree.
/// \param[in] placement Placement of the frame wrt the parent joint frame.
///
Frame(const std::string & name, const JointIndex parent_id, const SE3 & frame_placement):
Frame(const std::string & name, const JointIndex parent, const SE3 & frame_placement):
name(name)
, parent_id(parent_id)
, framePlacement(frame_placement)
, parent(parent)
, placement(frame_placement)
{}
///
......@@ -58,18 +58,18 @@ namespace se3
///
bool operator == (const Frame & other) const
{
return name == other.name && parent_id == other.parent_id
&& framePlacement == other.framePlacement ;
return name == other.name && parent == other.parent
&& placement == other.placement ;
}
/// \brief Name of the frame.
std::string name;
/// \brief Index of the parent joint.
JointIndex parent_id;
JointIndex parent;
/// \brief Placement of the frame wrt the parent joint.
SE3 framePlacement;
SE3 placement;
}; // struct Frame
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment