Closed TokyoClod closed 6 years ago
The vpColVector
returned by vpServo::computeControlLaw()
is a velocity twist (3 translations velocities vx,vy,y, + 3 rotations velocities wx,wy,wz) corresponding to the camera velocity.
In ROS you can convert this data structure:
geometry_msgs::TwistStampedConstPtr msg;
servo.setServo(vpServo::EYEINHAND_CAMERA);
...
vpColVector vc = servo.computeControlLaw();
msg->twist.linear.x = vc[0];
msg->twist.linear.y = vc[1];
msg->twist.linear.z = vc[2];
msg->twist.angular.x = vc[3];
msg->twist.angular.y = vc[4];
msg->twist.angular.z = vc[5];
@fspindle From the description in http://visp-doc.inria.fr/doxygen/visp-daily/classvpSimulatorCamera.html#a19368e64873f93c807a1bfe0c6f102df I think the form of rotations velocities is vpThetaUVector, so I am wondering if it is right just pass the vc[3]...vc[5] to geometry_msgs::Twist
The doc http://visp-doc.inria.fr/doxygen/visp-daily/classvpSimulatorCamera.html#a19368e64873f93c807a1bfe0c6f102df is completely wrong. I will fix it.
vpThetaUVector
represents an angular position, nor a velocity.
You may do as described in my previous post.
Form the function
vpColVector vpServo::computeControlLaw()
I get the velocity in camera frame in the form of thetaUI am wondering how to transform the velocity from thetaU form to Quaternion form so I can use it in ros.