8 #ifndef SWITCHVARIABLELINEAR_H_ 9 #define SWITCHVARIABLELINEAR_H_ 15 #include <gtsam/base/Lie.h> 37 inline void print(
const std::string& name=
"")
const {
38 std::cout <<
name <<
": " <<
d_ << std::endl;
43 return fabs(expected.
d_ -
d_) <= tol;
49 inline size_t dim()
const {
return 1; }
50 inline static size_t Dim() {
return 1; }
57 else if (x<0.0) x=0.0;
79 boost::optional<gtsam::Matrix&> H1=boost::none,
80 boost::optional<gtsam::Matrix&> H2=boost::none)
const {
81 if(H1) *H1 = -gtsam::Matrix::Identity(1, 1);
82 if(H2) *H2 = gtsam::Matrix::Identity(1, 1);
112 return key1.
equals(key2, tol);
119 ChartJacobian Horigin = boost::none, ChartJacobian Hother = boost::none) {
123 ChartJacobian H1 = boost::none, ChartJacobian H2 = boost::none) {
SwitchVariableLinear compose(const SwitchVariableLinear &p) const
gtsam::Vector localCoordinates(const SwitchVariableLinear &t2) const
GLM_FUNC_DECL genType e()
SwitchVariableLinear inverse() const
static gtsam::Vector Logmap(const SwitchVariableLinear &p)
static vertigo::SwitchVariableLinear Retract(const vertigo::SwitchVariableLinear &g, const TangentVector &v, ChartJacobian H1=boost::none, ChartJacobian H2=boost::none)
void print(const std::string &name="") const
static SwitchVariableLinear Expmap(const gtsam::Vector &v)
bool equals(const SwitchVariableLinear &expected, double tol=1e-5) const
static void Print(const vertigo::SwitchVariableLinear &key, const std::string &str="")
SwitchVariableLinear retract(const gtsam::Vector &v) const
gtsam::Vector TangentVector
static bool Equals(const vertigo::SwitchVariableLinear &key1, const vertigo::SwitchVariableLinear &key2, double tol=1e-8)
static int GetDimension(const vertigo::SwitchVariableLinear &key)
OptionalJacobian< 3, 3 > ChartJacobian
static SwitchVariableLinear identity()
SwitchVariableLinear between(const SwitchVariableLinear &l2, boost::optional< gtsam::Matrix &> H1=boost::none, boost::optional< gtsam::Matrix &> H2=boost::none) const
static TangentVector Local(const vertigo::SwitchVariableLinear &origin, const vertigo::SwitchVariableLinear &other, ChartJacobian Horigin=boost::none, ChartJacobian Hother=boost::none)
SwitchVariableLinear(double d)