Skip to content

Commit 7921bb9

Browse files
committed
Replace trajectories page on Ramsete with LTV Unicycle
RamseteController was deprecated in wpilibsuite/allwpilib#6494 Does 1 part of #2651 Signed-off-by: Jade Turner <[email protected]>
1 parent 2c1ca60 commit 7921bb9

File tree

2 files changed

+9
-30
lines changed

2 files changed

+9
-30
lines changed

source/docs/software/advanced-controls/trajectories/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ This section describes WPILib support for generating parameterized spline trajec
1111
constraints
1212
manipulating-trajectories
1313
transforming-trajectories
14-
ramsete
14+
ltv
1515
holonomic
1616
troubleshooting

source/docs/software/advanced-controls/trajectories/ramsete.rst source/docs/software/advanced-controls/trajectories/ltv.rst

+8-29
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,24 @@
1-
# Ramsete Controller
2-
The Ramsete Controller is a trajectory tracker that is built in to WPILib. This tracker can be used to accurately track trajectories with correction for minor disturbances.
1+
# LTV Unicycle Controller
2+
The LTV Unicycle Controller is a trajectory tracker that is built in to WPILib. This tracker can be used to accurately track trajectories with correction for minor disturbances.
33

4-
## Constructing the Ramsete Controller Object
5-
The Ramsete controller should be initialized with two gains, namely ``b`` and ``zeta``. Larger values of ``b`` make convergence more aggressive like a proportional term whereas larger values of ``zeta`` provide more damping in the response. These controller gains only dictate how the controller will output adjusted velocities. It does NOT affect the actual velocity tracking of the robot. This means that these controller gains are generally robot-agnostic.
6-
7-
.. note:: Gains of ``2.0`` and ``0.7`` for ``b`` and ``zeta`` have been tested repeatedly to produce desirable results when all units were in meters. As such, a zero-argument constructor for ``RamseteController`` exists with gains defaulted to these values.
4+
## Constructing the LTV Unicycle Controller Object
5+
The LTV controller should be initialized with two parameters, `dt` and `maxVelocity`. `dt` represents the timestep used in calculations and `maxVelocity` should be the max velocity your robot can achieve.
86

97
.. tab-set-code::
108
```java
11-
// Using the default constructor of RamseteController. Here
12-
// the gains are initialized to 2.0 and 0.7.
13-
RamseteController controller1 = new RamseteController();
14-
// Using the secondary constructor of RamseteController where
15-
// the user can choose any other gains.
16-
RamseteController controller2 = new RamseteController(2.1, 0.8);
9+
LTVUnicycle controller = new LTVUnicycleController(0.2, 9);
1710
```
1811

1912
```c++
20-
// Using the default constructor of RamseteController. Here
21-
// the gains are initialized to 2.0 and 0.7.
22-
frc::RamseteController controller1;
23-
// Using the secondary constructor of RamseteController where
24-
// the user can choose any other gains.
25-
frc::RamseteController controller2{2.1, 0.8};
13+
frc::LTVUnicycleController controller{0.2_s, 9_mps};
2614
```
2715

2816
```python
29-
from wpimath.controller import RamseteController
30-
# Using the default constructor of RamseteController. Here
31-
# the gains are initialized to 2.0 and 0.7.
32-
controller1 = RamseteController()
33-
# Using the secondary constructor of RamseteController where
34-
# the user can choose any other gains.
35-
controller2 = RamseteController(2.1, 0.8)
17+
controller = LTVUnicycleController(0.2, 9)
3618
```
3719

3820
## Getting Adjusted Velocities
39-
The Ramsete controller returns "adjusted velocities" so that the when the robot tracks these velocities, it accurately reaches the goal point. The controller should be updated periodically with the new goal. The goal comprises of a desired pose, desired linear velocity, and desired angular velocity. Furthermore, the current position of the robot should also be updated periodically. The controller uses these four arguments to return the adjusted linear and angular velocity. Users should command their robot to these linear and angular velocities to achieve optimal trajectory tracking.
21+
The LTV Unicycle controller returns "adjusted velocities" so that the when the robot tracks these velocities, it accurately reaches the goal point. The controller should be updated periodically with the new goal. The goal comprises of a desired pose, desired linear velocity, and desired angular velocity. Furthermore, the current position of the robot should also be updated periodically. The controller uses these four arguments to return the adjusted linear and angular velocity. Users should command their robot to these linear and angular velocities to achieve optimal trajectory tracking.
4022

4123
.. note:: The "goal pose" represents the position that the robot should be at a particular timestep when tracking the trajectory. It does NOT represent the final endpoint of the trajectory.
4224

@@ -90,6 +72,3 @@ The returned adjusted speeds can be converted to usable speeds using the kinemat
9072

9173
Because these new left and right velocities are still speeds and not voltages, two PID Controllers, one for each side may be used to track these velocities. Either the WPILib PIDController ([C++](https://github.wpilib.org/allwpilib/docs/development/cpp/classfrc_1_1_p_i_d_controller.html), [Java](https://github.wpilib.org/allwpilib/docs/development/java/edu/wpi/first/math/controller/PIDController.html), :external:py:class:`Python <wpimath.controller.PIDController>`) can be used, or the Velocity PID feature on smart motor controllers such as the TalonSRX and the SPARK MAX can be used.
9274

93-
## Ramsete in the Command-Based Framework
94-
For the sake of ease for users, a ``RamseteCommand`` class is built in to WPILib. For a full tutorial on implementing a path-following autonomous using RamseteCommand, see :ref:`docs/software/pathplanning/trajectory-tutorial/index:Trajectory Tutorial`.
95-

0 commit comments

Comments
 (0)