Putting MPC to work with a 4-wheel omnidirectional robot?
I am making the code based on a script from Christoph Rösmann. But I have serious doubts on how to apply the kinematics of a four-wheel omnidirectional robot to the algorithm, taking into account the input of the vector u of the controller;
// implements interface method
SystemDynamicsInterface::Ptr getInstance() const override { return std::make_shared<Omni_Model>(); }
// implements interface method
int getInputDimension() const override { return 2; }
// implements interface method
void dynamics(const Eigen::Ref<const StateVector>& x, const Eigen::Ref<const ControlVector>& u, Eigen::Ref<StateVector> f) const override
{
assert(x.size() == getStateDimension());
assert(u.size() == getInputDimension());
assert(x.size() == f.size() && "Omni_Model::dynamics(): x and f are not of the same size, do not forget to pre-allocate f.");
f[0] = u[0] * ?????
f[1] = u[0] * ????
f[2] = u[1]; ????
}
// implements interface method
bool getTwistFromControl(const Eigen::Ref<const Eigen::VectorXd>& u, geometry_msgs::Twist& twist) const override
{
assert(u.size() == getInputDimension());
twist.linear.x = u[0];
twist.linear.y = u[0];
twist.linear.z = 0;
twist.angular.z = u[1];
twist.angular.x = twist.angular.y = 0;
return true;
}
};
I don't know if I'm missing something, but what is your question?
I wanted to put the MPC developed by Christoph Rösmann with an omnidirectional robot. Link:. But I am not understanding how to connect the kinematics of the robot with the speed that is the output of the controller