q_size and qdot_size confusion in file rbdl/python/rbdl_ptr_functions.h

Issue #68 resolved
SongyanXIN
created an issue

Hi,

Inside the file rbdl/python/rbdl_ptr_functions.h, q_size and qdot_size is used interchangeable, for example:

    VectorNdRef Q = VectorFromPtr(const_cast<double*>(q_ptr), model.q_size);
    VectorNdRef QDot = VectorFromPtr(const_cast<double*>(qdot_ptr), model.q_size);
    VectorNdRef QDDot = VectorFromPtr(const_cast<double*>(qddot_ptr), model.q_size);
    VectorNdRef Tau = VectorFromPtr(const_cast<double*>(tau_ptr), model.q_size);

This is correct for most robots without a floating-base in which case q_size == qdot_size.

For a robot with floating-base joint and using Quaternion to represent its base orientation: q_size is not equal to qdot_size, minor correction shown below might be better:

    VectorNdRef Q = VectorFromPtr(const_cast<double*>(q_ptr), model.q_size);
    VectorNdRef QDot = VectorFromPtr(const_cast<double*>(qdot_ptr), model.qdot_size);
    VectorNdRef QDDot = VectorFromPtr(const_cast<double*>(qddot_ptr), model.qdot_size);
    VectorNdRef Tau = VectorFromPtr(const_cast<double*>(tau_ptr), model.qdot_size);

Comments (3)

  1. Log in to comment