TorBorve / mpc_local_planner

A nonlinear MPC used to control an autonomous car.
MIT License
37 stars 9 forks source link

How to post Twist topic on a real car? #12

Closed chan-yuu closed 2 days ago

chan-yuu commented 1 week ago

It's data structure is:

Header header
  uint32 seq
  time stamp
  string frame_id
Twist twist
  Vector3 linear
    float64 x
    float64 y
    float64 z
  Vector3 angular
    float64 x
    float64 y
    float64 z

I want to know how to calculate and publish Angular data. I think the twist here should be for vertical control. So, are we actually not using Angular?

TorBorve commented 1 week ago

For the mpc the only thing the twist is used for is to get the velocity of the car. It does this by taking the length of the "linear" vector.

If you just publish a twist message with this information then it should work.