Program Listing for File FactorTricycleKinematics.h

Return to documentation for file (include/mola_state_estimation_smoother/FactorTricycleKinematics.h)

/* -------------------------------------------------------------------------
 *   A Modular Optimization framework for Localization and mApping  (MOLA)
 * Copyright (C) 2018-2024 Jose Luis Blanco, University of Almeria
 * See LICENSE for license information.
 * ------------------------------------------------------------------------- */
#pragma once

#include <mola_kernel/factors/FactorBase.h>
#include <mrpt/core/exceptions.h>

namespace mola
{
class FactorTricycleKinematics : public FactorBase
{
    DEFINE_SERIALIZABLE(FactorTricycleKinematics, mola)

   public:
    FactorTricycleKinematics() = default;

    FactorTricycleKinematics(id_t kf_from, id_t kf_to, double deltaTime)
        : from_kf_(kf_from), to_kf_(kf_to), deltaTime_(deltaTime)
    {
    }

    id_t from_kf_ = INVALID_ID, to_kf_ = INVALID_ID;

    double deltaTime_ = .0;

    std::size_t edge_count() const override { return 2; }
    mola::id_t  edge_indices(const std::size_t i) const override;
};

}  // namespace mola