| aMotion_RampVelSteer | Index |
Definition:
Parameters:
| maxspd | - | The maximum speed for both motors. |
| minspd | - | The minimum speed for both motors. |
| dir | - | The direction input. |
Return Value:
Description:
This routine sets the speeds of two motors based on a single direction input. This subroutine requires that both motors be configured for velocity damping. The speeds will change gradually to new settings based on the current velocity damping parameters. This routine can be used to make gradual steering adjustments based on a signed direction input parameter. If the direction input is 0, both motors will go forward. If the direction input is positive, the robot will steer in the positive direction. If the direction input is negative, the robot will steer in the negative direction. Inputs with larger absolute values will cause sharper turns. The maxspd and minspd parameters can be used to adjust the maximum forward speed and arc of the sharpest turn. Increasing the minspd parameter will decrease the arc of the sharpest turn. Speed units depend on the current motion control parameters.
Example:
#include <aMotion.tea>
void main()
{
aMotion_RampVelSteer(60,15,-5);
}
This would adjust the speeds of two motors on a robot and make it turn in a wide arc.
#include <aMotion.tea>
void main()
{
aMotion_RampVelSteer(60,15,45);
}
This would adjust the speeds of two motors on a robot and make it turn in a tight arc.
Related: