Example file for the Repredictor implementation.
More...
#include <mrs_lib/repredictor.h>
#include <mrs_lib/lkf.h>
#include <mrs_lib/mutex.h>
#include <random>
#include <fstream>
#include <mutex>
#include <thread>
#include <ros/ros.h>
#include <mrs_msgs/Float64Stamped.h>
|
| mrs_lib |
| All mrs_lib functions, classes, variables and definitions are contained in this namespace.
|
|
|
enum | type_e { input,
meas_fast,
meas_slow
} |
|
|
template<int rows> |
Eigen::Matrix< double, rows, 1 > | multivariate_gaussian (const Eigen::Matrix< double, rows, rows > &cov) |
|
A_t | generateA (const double dt) |
|
B_t | generateB ([[maybe_unused]] const double dt) |
|
const H_t | H ((H_t()<< 1, 0).finished()) |
|
void | process_msg (const mrs_msgs::Float64Stamped::ConstPtr msg, type_e type) |
|
void | callback_input (const mrs_msgs::Float64Stamped::ConstPtr msg) |
|
void | callback_meas_fast (const mrs_msgs::Float64Stamped::ConstPtr msg) |
|
void | callback_meas_slow (const mrs_msgs::Float64Stamped::ConstPtr msg) |
|
void | meas_generator_fast () |
|
void | meas_generator_slow () |
|
int | main (int argc, char **argv) |
|
|
const Q_t | Q = 2.5*Q_t::Identity() |
|
const R_t | R_fast = 5.5*R_t::Identity() |
|
const R_t | R_slow = 0.01*R_t::Identity() |
|
const x_t | x0 = x_t::Zero() |
|
const P_t | P0 = 5.0*P_t::Identity() |
|
const u_t | u0 = u_t::Zero() |
|
const ros::Time | t0 = ros::Time(0) |
|
const std::shared_ptr< lkf_t > | lkf_ptr = std::make_shared<lkf_t>(generateA, generateB, H) |
|
const unsigned | buf_sz = 100 |
|
std::mutex | rep_pubs_mtx |
|
rep_t | rep (x0, P0, u0, Q, t0, lkf_ptr, buf_sz) |
|
ros::Publisher | pub_pos_est |
|
ros::Publisher | pub_vel_est |
|
std::mutex | x_mtx |
|
x_t | x = x_t::Random() |
|
ros::Publisher | pub_meas_fast |
|
ros::Publisher | pub_meas_slow |
|
Example file for the Repredictor implementation.
- Author
- Matouš Vrba - vrbam.nosp@m.ato@.nosp@m.fel.c.nosp@m.vut..nosp@m.cz
This example may be run after building mrs_lib by executing rosrun mrs_lib repredictor_example
.
See repredictor/example.cpp.