# Revision history [back]

### How to get instantaneous velocity value when using gazebo ros_diff_drive plugin

I am using the following gazebo plugin to model a diff drive mobile robot in gazebo and then doing a PID for velocity control of the mobile robot.

I understand that in order to do a PID controller for the movement, i need to sense the current velocity of the robot. and get the error between that and the reference velocity.

Problem is then how do I get the current velocity?

<gazebo>
<plugin name="next_controller" filename="libgazebo_ros_diff_drive.so">
<commandTopic>cmd_vel</commandTopic>
<odometryTopic>odom</odometryTopic>
<odometryFrame>odom</odometryFrame>