UTNuclearRoboticsPublic / jog_arm

A real-time robot arm jogger.
45 stars 22 forks source link

Question about velocity calculation #107

Open sritee opened 4 years ago

sritee commented 4 years ago

Thanks for the great repository and clean code!

I was going through the code for educational purposes, and had a question about the following line.

//Include a velocity estimate for velocity-controlled robots
  Eigen::VectorXd joint_vel(delta_theta / parameters_.publish_period);

https://github.com/UTNuclearRoboticsPublic/jog_arm/blob/c88847cd2d55c80d2066af6394e038ed9bf2c513/jog_arm/src/jog_arm/jog_arm_server.cpp#L552

Multiplying the inverse of the jacobian with the end eff. vel should give us the joint velocities directly. Why do we need to divide this by publish time period? I am probably misunderstanding something.

Thank you!

AndyZe commented 4 years ago

I think what you propose sounds like a decent option.

I believe the way it's implemented now is more efficient, though. Since we already have delta_theta, and dividing by a scalar is much more efficient than a matrix multiplication.