Stappy
December 5, 2019, 12:41pm
1
Anyone have some good links to FTC block programming tutorials or good code examples for Mecanum drive?
Go look at the WPILib source code to be honest. It is a great example! Good luck!
1 Like
If you take a look at our robot code from 2019, it has a successful implementation of mecanum drive code. Here’s the link to the GitHub site:
This should give you an idea of what the code looks like in practice. Feel free to use it as you wish.
Stappy
December 5, 2019, 6:05pm
4
Not finding any WPILib examples for FTC and the android stuff.
You will need to reimplement some of the WPILib source to work with FTC. The source code you will need to convert is located here:
/**
* Drive method for Mecanum platform.
*
* <p>Angles are measured clockwise from the positive X axis. The robot's speed is independent
* from its angle or rotation rate.
*
* @param ySpeed The robot's speed along the Y axis [-1.0..1.0]. Right is positive.
* @param xSpeed The robot's speed along the X axis [-1.0..1.0]. Forward is positive.
* @param zRotation The robot's rotation rate around the Z axis [-1.0..1.0]. Clockwise is
* positive.
* @param gyroAngle The current angle reading from the gyro in degrees around the Z axis. Use
* this to implement field-oriented controls.
*/
@SuppressWarnings("ParameterName")
public void driveCartesian(double ySpeed, double xSpeed, double zRotation, double gyroAngle) {
if (!m_reported) {
HAL.report(tResourceType.kResourceType_RobotDrive,
tInstances.kRobotDrive2_MecanumCartesian, 4);
m_reported = true;
}
This file has been truncated. show original
Team 2539 performed with an excellent mecanum drive in 2019. The code (the code is written in PYTHON however) can be found here , under the subsystems folder, and in the mecanum drive file.
system
Closed
December 4, 2020, 6:47pm
7
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.