code explanation
hi guys. I need help understanding this code. What does it do?
00802 private void publishVelocity(double linearVelocityX, double linearVelocityY,
00803 double angularVelocityZ) {
00804 currentVelocityCommand.getLinear().setX(linearVelocityX);
00805 currentVelocityCommand.getLinear().setY(-linearVelocityY);
00806 currentVelocityCommand.getLinear().setZ(0);
00807 currentVelocityCommand.getAngular().setX(0);
00808 currentVelocityCommand.getAngular().setY(0);
00809 currentVelocityCommand.getAngular().setZ(-angularVelocityZ);
00810 }
Publish the velocity as a ROS Twist message.
Parameters:
linearVelocityX The normalized linear velocity (-1 to 1).
angularVelocityZ The normalized angular velocity (-1 to 1).
currentVelocityCommand declaration:
private geometry_msgs.Twist currentVelocityCommand;
It seems to me that the actual publish code is missing here.
Right, apart from that the code modifies an existing velocity command with respect to linear and angular velocity ( http://people.wku.edu/david.neal/117/... ). You can see the layout of the command using rosmsg show geometry_msgs/Twist.