Well, currently there isn't, BUT THERE SHOULD BE! :) I don't know how we missed that. I'll add it this weekend, and put a new release out. We need to add functionality for some of our other sensors anyway.
Christopher,
I just added a LeftVelocity/RightVelocity property to the DifferentialMotorController class, and a Velocity property to the DCMotorControllerBase classes. Having added it to the DCMotorControllerBase class means that the PwmDCMotorController class will inherit this functionality.
To be able to get the latest value of the Velocity for PwmDCMotorController class instance, you will need to use the following sequence:
pwmMotor.Update(); // This queries the value of the velocity on the Serializer, // waits and processes the response, and sets the value of the Velocity Property. vel = pwmMotor.Velocity; // Then, you read the property for the value.
You perform a similar operation with the DifferentialMotorController class too:
diffMoCo.Update(); leftVel = diffMoCo.LeftVelocity; rightVel = diffMoCo.RightVelocity;
Also note, that this will require a firmware update, so that you can query the motor velocities separately. So, we will release a new firmware version too (v1.4.2). Right now, the command 'vel' returns both velocities'. We're changing it so that you can specify the motor you want queried for velocity (e.g. "vel 1", or "vel 1 2").
I'll test these changes by Wednesday, and then release it.
Sorry for the delay...We've just been swamped... :)
I also modified the PIDMotorController class to have a Motor1Velocity and Motor2Velocity Property.
To obtain the velocities, you invoke the same interface as above (note: pmc = PIDMotorController):
pmc.Update(); // This queries the value of the velocity for both motors on the Serializer, // waits and processes the response, and sets the value of Motor 1 & 2 Velocity Properties. Console.WriteLine("Motor 1 Velocity: {0}", pmc.Motor1Velocity); Console.WriteLine("Motor 2 Velocity: {0}", pmc.Motor2Velocity);
I'll have this tested, and out on the site by Wednesday night. I've already modified the 'vel' command in the v1.4.3 firmware, and have tested it.
I also added a LineFollowingSensor to the .NET library, so customers can utilitze our I2C Line Following Sensor.
Okay, all of the changes have been made, and tested with both the .NET library, and the Serializer firmware...Now I just need to get the documentation updated. :) I'll do that tomorrow.
The modifications to the 'vel' command within the firmware allow it to be backwards compatible. So, if 'vel' is typed, then both values for Motor 1 and Motor 2 are returned (like before), else if a motor id (or both) is/are specified, then those specific velocities will be returned.
>vel 0 0 >
>vel 1 15 >
>vel 1 2 14 16 >