The goal of the drive to position command interface is to allow RVR to drive to a position in its plane of reference and stop and orient its self with respect to the yaw provided.
You can find SDK documentation that describes the drive to position command interfaces for Asyncio here and for Observer here. There are two functions in each file related to drive to position:
drive_to_position_normalized. The main difference between the two commands is that one uses some SI units while the other uses some normalized units. In
yaw_angle is a float value while in
drive_to_position_normalized it is a int16_t value. In
linear_speed is in m/s and a float value while in
drive_to_position_normalized it is in normalized units between 0 and 127 and a int8_t value. The
drive_to_position_normalized command is useful for saving bandwidth when transferring many commands as it’s payload is smaller and when the user does not care about the units of
linear_speed but rather going fast or slow.
You can find some example code for
drive_to_position_si here and for
drive_to_position_normalized here. You will notice that in each example the following code is run first.
# Reset the yaw and locator.
The goal of this code snippet is to reset RVR’s current position to (0,0) in meters and the current yaw heading to 0 degrees. Position and yaw are independent. With respect to RVR the Y-axis is forward and the X-axis is to the right. Yaw follows the right hand rule, it increases to the left and decreases to the right. Lets look at an example command.
yaw_angle = -90, # 0 degrees is straight ahead, +CCW (Following the right hand rule)
x = 0, # Target position X coordinate in meters
y = 0.5, # Target position Y coordinate in meters
linear_speed = 64 , # Max speed in transit to target. Normalized in the range [0..127]
flags = 0, # Option flags
This command will direct RVR to drive from it’s current position to a new position of (0, 0.5) in meters with respect to where position was last zeroed. On reaching the new position RVR will turn -90 degrees with respect to the last time yaw was zeroed and with respect to the right hand rule. While driving to the new position RVR will not exceed 64 normalized units in driving speed.