Function pfield::approximateJointVelocities
Defined in File pfield_common.hpp
Function Documentation
-
inline std::vector<double> pfield::approximateJointVelocities(const std::vector<double> ¤tJointAngles, const std::vector<double> &previousJointAngles, const double dt)
Approximates joint velocities given current and previous joint angles and a time step.
Note
This function uses finite differencing to estimate joint velocities which may be noisy and inaccurate for small dt values. This can likely be improved with filtering or by providing more historical velocity data to compute a better estimate.
- Parameters:
currentJointAngles – The current joint angles [rad]
previousJointAngles – The previous joint angles [rad]
dt – The time difference between the current and previous joint angles [s]
- Returns:
std::vector<double> The approximated joint velocities [rad/s]