Dear @mherb, I am trying to use your helpful kalman filter library for humanoid motion state estimation, based on ukf.
And my state variable is center of mass position and velocity x(comx, comy, comz, dotcomx, dotcomy, dotcomz), the control input variable is zmp position and vertical force u(zmpx,zmpy,forcez), and measurement varible is com position from encoder, and acceleration from IMU z(comx_enc,comy_enc,comz_enc,acc_x,acc_y,acc_z).
And both the system model f(x,u)and measurement model h(x,u) are nonlinear, the definition can be found at the bottom. Then when compiling, I have an error when instantiating the MeasurementModel. And the error says
error: cannot declare variable ‘measurement_model’ to be of abstract type ‘UKF_LIPM::LIPM::LipMeasurementModel<float>’
MeasurementModel measurement_model;
^~~~~~~~~~~~~~~~~
In file included from /home/qingwei/catkin_ws/src/walk_stablization_controller/src/walk_stablization_controller.cpp:36:0:
/home/qingwei/catkin_ws/src/walk_stablization_controller/src/LipMeasurementModel.hpp:55:7: note: because the following virtual functions are pure within ‘UKF_LIPM::LIPM::LipMeasurementModel<float>’:
class LipMeasurementModel : public Kalman::LinearizedMeasurementModel<State<T>, LipMeasurement<T>, CovarianceBase>
^~~~~~~~~~~~~~~~~~~
In file included from /home/qingwei/catkin_ws/src/walk_stablization_controller/include/walk_stablization_controller/kalman/LinearizedMeasurementModel.hpp:25:0,
from /home/qingwei/catkin_ws/src/walk_stablization_controller/src/LipMeasurementModel.hpp:4,
from /home/qingwei/catkin_ws/src/walk_stablization_controller/src/walk_stablization_controller.cpp:36:
/home/qingwei/catkin_ws/src/walk_stablization_controller/include/walk_stablization_controller/kalman/MeasurementModel.hpp:60:29: note: Kalman::MeasurementModel<StateType, MeasurementType, CovarianceBase>::Measurement Kalman::MeasurementModel<StateType, MeasurementType, CovarianceBase>::h(const State&) const [with StateType = UKF_LIPM::LIPM::State<float>; MeasurementType = UKF_LIPM::LIPM::LipMeasurement<float>; CovarianceBase = Kalman::StandardBase; Kalman::MeasurementModel<StateType, MeasurementType, CovarianceBase>::Measurement = UKF_LIPM::LIPM::LipMeasurement<float>; Kalman::MeasurementModel<StateType, MeasurementType, CovarianceBase>::State = UKF_LIPM::LIPM::State<float>]
virtual Measurement h(const State& x) const = 0;
The base class virtual interface of h(x) is virtual Measurement h(const State& x) const, but the h(x) in your derived class is M h(const S& x, const C& u) const.
Dear @mherb, I am trying to use your helpful kalman filter library for humanoid motion state estimation, based on ukf.
And my state variable is center of mass position and velocity
x(comx, comy, comz, dotcomx, dotcomy, dotcomz)
, the control input variable is zmp position and vertical forceu(zmpx,zmpy,forcez)
, and measurement varible is com position from encoder, and acceleration from IMUz(comx_enc,comy_enc,comz_enc,acc_x,acc_y,acc_z).
And both the system model
f(x,u)
and measurement modelh(x,u)
are nonlinear, the definition can be found at the bottom. Then when compiling, I have an error when instantiating theMeasurementModel
. And the error saysAnd I noticed in
MeasurementModel.hpp
the measurement functionh
is only a function of statex
, and no control input 'u'. Do you have any suggestions on where my problem is and how can I solve it? https://github.com/mherb/kalman/blob/9f40c2f7bedb08e964297a00a2b9360036590896/include/kalman/MeasurementModel.hpp#L59I have defined the measurement model as
I attached the implementation and system/measurement model below, for your review.
Thank you in advance for your help.
Best regards. Qingwei
Implementation
System model LIPMSystemModel.hpp
Measurement model LipMeasurementModel.hpp