Skip to content
Snippets Groups Projects
Commit 1be38ec6 authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Add API shortcuts to factors

parent 614488c4
No related branches found
No related tags found
1 merge request!346Resolve "Frame/Capture/Feature/Landmark Other as list/vectors in FactorBase"
This commit is part of merge request !346. Comments created here will be created in the context of that merge request.
...@@ -144,6 +144,14 @@ class FactorBase : public NodeBase, public std::enable_shared_from_this<FactorBa ...@@ -144,6 +144,14 @@ class FactorBase : public NodeBase, public std::enable_shared_from_this<FactorBa
**/ **/
CaptureBasePtr getCapture() const; CaptureBasePtr getCapture() const;
/** \brief Returns a pointer to its frame
**/
FrameBasePtr getFrame() const;
/** \brief Returns a pointer to its capture's sensor
**/
SensorBasePtr getSensor() const;
/** \brief Returns the factor residual size /** \brief Returns the factor residual size
**/ **/
virtual unsigned int getSize() const = 0; virtual unsigned int getSize() const = 0;
......
...@@ -155,6 +155,18 @@ CaptureBasePtr FactorBase::getCapture() const ...@@ -155,6 +155,18 @@ CaptureBasePtr FactorBase::getCapture() const
return getFeature()->getCapture(); return getFeature()->getCapture();
} }
FrameBasePtr FactorBase::getFrame() const
{
assert(getCapture() != nullptr && "calling getFrame before linking with a capture");
return getCapture()->getFrame();
}
SensorBasePtr FactorBase::getSensor() const
{
assert(getCapture() != nullptr && "calling getSensor before linking with a capture");
return getCapture()->getSensor();
}
void FactorBase::setStatus(FactorStatus _status) void FactorBase::setStatus(FactorStatus _status)
{ {
if (getProblem() == nullptr) if (getProblem() == nullptr)
......
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