mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[copybara] mostrobotpy to allwpilib (#8503)
Resync with `mostrobotpy` This mostly involves the big "ignore almost everything in the HAL project" and some fixups for the Addressable LED classes. Required two small hand fixes to get it building over here with bazel, and with more compiler warnings on. I also manually zeroed out the `repo_url` field in the toml files to avoid unnecessary churn whenever it goes from a release build to a development build. I already did this with `version` field in there, and will do a follow up PR that updates the copybara script to do it automatically. --------- Co-authored-by: Default email <default@default.com>
This commit is contained in:
55
wpimath/src/main/python/semiwrap/MecanumDriveKinematics.yml
Normal file
55
wpimath/src/main/python/semiwrap/MecanumDriveKinematics.yml
Normal file
@@ -0,0 +1,55 @@
|
||||
extra_includes:
|
||||
- wpystruct.h
|
||||
|
||||
classes:
|
||||
wpi::math::MecanumDriveKinematics:
|
||||
methods:
|
||||
MecanumDriveKinematics:
|
||||
ToWheelSpeeds:
|
||||
doc: |
|
||||
Performs inverse kinematics to return the wheel speeds from a desired
|
||||
chassis velocity. This method is often used to convert joystick values into
|
||||
wheel speeds.
|
||||
|
||||
This function also supports variable centers of rotation. During normal
|
||||
operations, the center of rotation is usually the same as the physical
|
||||
center of the robot; therefore, the argument is defaulted to that use case.
|
||||
However, if you wish to change the center of rotation for evasive
|
||||
maneuvers, vision alignment, or for any other use case, you can do so.
|
||||
|
||||
:param chassisSpeeds: The desired chassis speed.
|
||||
:param centerOfRotation: The center of rotation. For example, if you set the
|
||||
center of rotation at one corner of the robot and
|
||||
provide a chassis speed that only has a dtheta
|
||||
component, the robot will rotate around that
|
||||
corner.
|
||||
|
||||
:returns: The wheel speeds. Use caution because they are not normalized.
|
||||
Sometimes, a user input may cause one of the wheel speeds to go
|
||||
above the attainable max velocity. Use the
|
||||
:meth:`MecanumDriveWheelSpeeds.normalize` method to rectify
|
||||
this issue. In addition, you can use Python unpacking syntax
|
||||
to directly assign the wheel speeds to variables::
|
||||
|
||||
fl, fr, bl, br = kinematics.toWheelSpeeds(chassisSpeeds)
|
||||
overloads:
|
||||
const ChassisSpeeds&, const Translation2d& [const]:
|
||||
const ChassisSpeeds& [const]:
|
||||
ToChassisSpeeds:
|
||||
ToTwist2d:
|
||||
overloads:
|
||||
const MecanumDriveWheelPositions&, const MecanumDriveWheelPositions& [const]:
|
||||
const MecanumDriveWheelPositions& [const]:
|
||||
GetFrontLeft:
|
||||
GetFrontRight:
|
||||
GetRearLeft:
|
||||
GetRearRight:
|
||||
Interpolate:
|
||||
ToChassisAccelerations:
|
||||
ToWheelAccelerations:
|
||||
overloads:
|
||||
const ChassisAccelerations&, const Translation2d& [const]:
|
||||
const ChassisAccelerations& [const]:
|
||||
|
||||
inline_code: |
|
||||
SetupWPyStruct<wpi::math::MecanumDriveKinematics>(cls_MecanumDriveKinematics);
|
||||
Reference in New Issue
Block a user