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

fix() and unfix() are global. Add fixIntrinsics() and fixExtrinsics()

parent c9adc3ff
No related branches found
No related tags found
No related merge requests found
......@@ -97,7 +97,28 @@ void SensorBase::removeStateBlocks()
void SensorBase::fix()
{
// fix only extrinsics
for( auto sbp : state_block_vec_)
if (sbp != nullptr)
{
sbp->fix();
if (getProblem() != nullptr)
getProblem()->updateStateBlockPtr(sbp);
}
}
void SensorBase::unfix()
{
for( auto sbp : state_block_vec_)
if (sbp != nullptr)
{
sbp->unfix();
if (getProblem() != nullptr)
getProblem()->updateStateBlockPtr(sbp);
}
}
inline void SensorBase::fixExtrinsics()
{
for (unsigned int i = 0; i < 2; i++)
{
auto sbp = state_block_vec_[i];
......@@ -110,9 +131,8 @@ void SensorBase::fix()
}
}
void SensorBase::unfix()
inline void SensorBase::unfixExtrinsics()
{
// unfix only extrinsics
for (unsigned int i = 0; i < 2; i++)
{
auto sbp = state_block_vec_[i];
......@@ -125,6 +145,36 @@ void SensorBase::unfix()
}
}
inline void SensorBase::fixIntrinsics()
{
for (unsigned int i = 2; i < state_block_vec_.size(); i++)
{
auto sbp = state_block_vec_[i];
if (sbp != nullptr)
{
sbp->fix();
if (getProblem() != nullptr)
getProblem()->updateStateBlockPtr(sbp);
}
}
}
inline void SensorBase::unfixIntrinsics()
{
for (unsigned int i = 2; i < state_block_vec_.size(); i++)
{
auto sbp = state_block_vec_[i];
if (sbp != nullptr)
{
sbp->unfix();
if (getProblem() != nullptr)
getProblem()->updateStateBlockPtr(sbp);
}
}
}
void SensorBase::registerNewStateBlocks()
{
if (getProblem() != nullptr)
......
......@@ -101,6 +101,10 @@ class SensorBase : public NodeBase, public std::enable_shared_from_this<SensorBa
void fix();
void unfix();
void fixExtrinsics();
void unfixExtrinsics();
void fixIntrinsics();
void unfixIntrinsics();
/** \brief Adds all stateBlocks of the sensor to the wolfProblem list of new stateBlocks
**/
......
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