Program Listing for File Parameters.h

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

/*               _
 _ __ ___   ___ | | __ _
| '_ ` _ \ / _ \| |/ _` | Modular Optimization framework for
| | | | | | (_) | | (_| | Localization and mApping (MOLA)
|_| |_| |_|\___/|_|\__,_| https://github.com/MOLAorg/mola

 Copyright (C) 2018-2026 Jose Luis Blanco, University of Almeria,
                         and individual contributors.
 SPDX-License-Identifier: GPL-3.0
 See LICENSE for full license information.
 Closed-source licenses available upon request, for this odometry package
 alone or in combination with the complete SLAM system.
*/


#pragma once

#include <mola_kernel/Georeferencing.h>
#include <mrpt/containers/yaml.h>
#include <mrpt/math/TPoint3D.h>
#include <mrpt/math/TTwist3D.h>
#include <mrpt/typemeta/TEnumType.h>

namespace mola::state_estimation_smoother
{

enum class KinematicModel : uint8_t
{
    ConstantVelocity,
    Tricycle,
};

class Parameters
{
   public:
    Parameters() = default;

    void loadFrom(const mrpt::containers::yaml& cfg);


    std::string vehicle_frame_name = "base_link";

    std::string reference_frame_name = "map";

    std::string enu_frame_name = "enu";



    KinematicModel kinematic_model = KinematicModel::ConstantVelocity;

    double max_time_to_use_velocity_model = 2.0;  // [s]

    double sliding_window_length = 5.0;  // [s]

    double min_time_difference_to_create_new_frame = 0.01;  // [s]

    double time_between_frames_to_warning = 3.0;  // [s]

    double gnss_nearby_keyframe_stamp_tolerance = 1.0;  // [s]

    double imu_nearby_keyframe_stamp_tolerance = 0.10;  // [s]

    double sigma_random_walk_acceleration_linear  = 1.0;  // [m/s²]
    double sigma_random_walk_acceleration_angular = 1.0;  // [rad/s²]
    double sigma_integrator_position              = 0.10;  // [m]
    double sigma_integrator_orientation           = 0.10;  // [rad]

    double sigma_twist_from_consecutive_poses_linear  = 1.0;  // [m/s]
    double sigma_twist_from_consecutive_poses_angular = 1.0;  // [rad/s]

    mrpt::math::TTwist3D initial_twist;

    // Defaults: somewhat confident that the vehicle is near rest.
    // Change these if needed to start with the vehicle at high speed.
    double initial_twist_sigma_lin = 0.1;  // [m/s]
    double initial_twist_sigma_ang = 0.1;  // [rad/s]

    bool enforce_planar_motion = false;

    std::optional<double> link_first_pose_to_reference_origin_sigma;



    double imu_attitude_sigma_deg = 2.0;

    double imu_attitude_azimuth_offset_deg = 0.0;

    double imu_normalized_gravity_alignment_sigma = 0.4;



    bool estimate_geo_reference = false;

    std::optional<mola::Georeferencing> fixed_geo_reference;

    double convergence_max_position_sigma = 1.0;  // [m]

    double convergence_max_orientation_sigma_deg = 5.0;  // [deg]

    bool publish_estimated_georef_on_convergence = true;

    double gnss_huber_threshold = 1.5;  // [sigmas]



    uint32_t additional_isam2_update_steps = 3;



    std::string do_process_imu_labels_re = ".*";

    std::string do_process_odometry_labels_re = ".*";

    std::string do_process_gnss_labels_re = ".*";


    struct Visualization
    {
        bool show_console_messages = true;

        // this is automatically called by parent's loadFrom()
        void loadFrom(const mrpt::containers::yaml& cfg);
    };
    Visualization visualization;
};

}  // namespace mola::state_estimation_smoother

MRPT_ENUM_TYPE_BEGIN_NAMESPACE(
    mola::state_estimation_smoother, mola::state_estimation_smoother::KinematicModel)
MRPT_FILL_ENUM(KinematicModel::ConstantVelocity);
MRPT_FILL_ENUM(KinematicModel::Tricycle);
MRPT_ENUM_TYPE_END()