Commit Graph

270 Commits

Author SHA1 Message Date
Tyler Veness
ffa4b907c0 Fix C++ floating point literal formatting (#2114)
Found formatting errors with this regex
"([^a-z0-9\.]\.[0-9]|[^a-z0-9\.][0-9]\.[^a-z0-9\.])" and ignored false
positives.

Fixes #2112.
2019-11-20 21:48:15 -08:00
Austin Shalit
5f85457a97 Add usage reporting for AddressableLED (#2108) 2019-11-20 20:13:39 -08:00
Oblarg
fa85fbfc1c Template C++ TrapezoidProfile and ProfiledPIDController on units (#2109) 2019-11-20 20:11:46 -08:00
Thad House
5443fdabc1 Directly construct PWM port from HAL, avoid wpilib PWM object (#2106) 2019-11-20 14:48:14 -08:00
Prateek Machiraju
45201d15fc Add encoder distance overload to DifferentialDriveOdometry (#2096)
Also force encoders to be reset to zero on pose reset.
2019-11-19 09:56:34 -08:00
Tyler Veness
845aba33fe Make feedforward classes constexpr (#2103)
ArmFeedforward::Calculate() can't be made constexpr because std::cos()
and thus units::math::cos() is not constexpr.

Fixes #2101.
2019-11-19 06:47:59 -08:00
Thad House
8ed2059074 Add AddressableLED (#2092) 2019-11-17 16:39:38 -08:00
Prateek Machiraju
841ef91c0f Use gyro angle instead of robot angle for odometry (#2081)
The odometry classes previously took in the robot angle as an argument, meaning that users had to take care of offsetting the gyro themselves to accurately report the robot angle. This change will make it so that users will not have to worry about resetting gyros and adding offsets themselves, as this will be handled by the odometry classes.
2019-11-15 17:34:10 -08:00
Thad House
82b2170feb Add DMA support to HAL and WPILibC (#2080) 2019-11-14 22:52:34 -08:00
Thad House
8280b7e3af Add DutyCycleEncoder and AnalogEncoder (#2040) 2019-11-14 22:51:33 -08:00
Thad House
3cce61b89f Add SmartDashboard::GetEntry function in C++ (#2064)
Existed in Java already.
2019-11-12 17:11:32 -08:00
Peter Johnson
3e049e02f0 Add name to HAL Notifier 2019-11-11 22:03:29 -08:00
Oblarg
e3dd1c5d77 Fix small bug in SplineHelper (#2061)
Also add comments for clamped cubic solution.
2019-11-10 22:52:24 -08:00
Oblarg
7dc7c71b58 Add feedforward components (#2045)
Add helper classes for computing feedforwards with parameters supplied by the characterization tool.
2019-11-09 20:16:42 -08:00
sciencewhiz
94843adb8f Standardize documentation of Speed Controllers bounds (#2043)
Some were in constructor docs, some in init function docs, and some
inline in code. Move them all to class docs.
2019-11-09 09:14:53 -08:00
Thad House
9bcff37b93 Add HAL specific version of wpi_setError (#2055)
Cleans up error writing, and allows fewer headers to be included in many of the wpilibc cpp files.

This removes all usages of the hal/HAL.h header.
2019-11-08 22:53:20 -08:00
Thad House
ff39a96cee Make DigitalOutput a DigitalSource (#2054)
It's perfectly safe to use as a DigitalSource, and can enable some cool tricks.
2019-11-07 20:03:43 -08:00
Thad House
5ccad2e8a4 Fix frc2::Timer returning incorrect timestamp values (#2057) 2019-11-07 20:02:27 -08:00
Thad House
384d00f9e6 Fix various duty cycle bugs (#2047) 2019-11-06 14:05:25 -08:00
Peter Johnson
7508aada93 Add ability to end startCompetition() main loop (#2032)
This is useful for both cleanly exiting from simulation and for unit testing
at a framework level.

This change required removing move constructor/assignment from IterativeRobot.
2019-11-05 21:33:09 -08:00
carbotaniuman
ed30d5d40e Add JSON support for Trajectories (#2025) 2019-11-02 11:35:03 -07:00
Thad House
1d695a1660 Add FPGA Duty Cycle support (#1987) 2019-11-01 23:41:30 -07:00
Thad House
509819d83f Split the two command implementations into separate libraries (#2012)
This will allow us at the user code side to determine to include old commands, new commands or both.
2019-11-01 21:58:54 -07:00
Oblarg
c5186d8159 Clean up PIDCommand (#2010)
PIDCommand uses a function based (callback) model, so functions designed for use in derived classes are of limited utility.
2019-11-01 13:11:55 -07:00
Oblarg
9ebd23d61e Add setVoltage method to SpeedController (#1997)
Add a voltage-compensated setVoltage method to SpeedController, which is sorely needed to help teams use feedforward-based controls effectively. Also uses correct units on the cpp side.

Also update relevant examples.
2019-11-01 09:32:40 -07:00
Oblarg
f33bd9f050 Fix NPE in RamseteCommand (#2019) 2019-11-01 09:26:48 -07:00
Thad House
9dc30797e4 Fix usage reporting indices (#2009)
According to NI, 0 is unspecified, and all the indices need to be
index + 1, so the first index becomes 1.
2019-10-29 21:34:10 -07:00
Peter Johnson
0be6b64756 Use constexpr for DifferentialDriveKinematics 2019-10-28 09:19:41 -07:00
Thad House
936627bd94 wpilibc: Remove direct CameraServer dependency (#1989)
This makes linking easier, particularly for third party vendors and other language wrappers.
2019-10-27 08:37:30 -07:00
Oblarg
75438ab2ce Add RamseteCommand (#1951) 2019-10-26 21:33:41 -07:00
Oblarg
dbc33b61e1 Fix Timer usage in TrapezoidProfileCommand (#1992) 2019-10-26 12:50:30 -07:00
Oblarg
79f8c5644a Add TrapezoidProfileCommand (#1962) 2019-10-26 09:58:13 -07:00
Prateek Machiraju
9440edf2b5 Refactor TrajectoryGenerator (#1972) 2019-10-26 09:39:47 -07:00
Oblarg
73a30182c3 Add frc2::Timer (#1968)
This is a unit-safe version of frc::Timer.
Undo previous (#1815) deprecation of parts of frc::Timer.
2019-10-26 08:21:40 -07:00
Oblarg
cbe05e7e8a Update ProfiledPIDController API (#1967) 2019-10-24 20:37:55 -07:00
Peter Johnson
2c50937975 Fix implicitly deleted move constructors (#1954)
These were incorrect and exhibited as warnings on more recent versions of
clang (notably on Mac).

- Use pointers instead of references internally in GenericHID and *Drive
- Leave PIDBase, PIDController, and Resource non-moveable
- Remove the atomic from m_disabled in NidecBrushless
- Make Timer and Trigger copyable as well as moveable
- Implement custom move constructor/assignment for SendableChooserBase

Also comment out some unused variables that caused clang warnings.
2019-10-19 11:36:44 -07:00
Peter Johnson
05c25deb7b Fix move handling of C++ Sendable in SmartDashboard and LiveWindow 2019-10-19 11:36:24 -07:00
Oblarg
53816155ba Improve command decorator names (#1945) 2019-10-19 08:13:33 -07:00
Prateek Machiraju
c10f2003c5 Add generateTrajectory overload (#1944)
Add an overload for the generateTrajectory method that accepts a DifferentialDriveKinematics instance instead of a list of constraints. This instance is used to automatically create a DifferentialDriveKinematicsConstraint behind the scenes, saving the user some verbosity.
2019-10-18 08:02:42 -07:00
Oblarg
f4eedf597f Fix ConcurrentModificationException in CommandScheduler (#1938) 2019-10-18 07:56:12 -07:00
Matt
bb0b207d2f Fix array out of bounds exception caused by parallel race group (#1935)
The current index would be set to -1 by the execute method of ParallelRaceGroup,
and then an index out of bounds exception would be thrown by the end() method of
SequentialCommandGroup. This change bound checks the current command index as well
as only calls end at the end of parallel race group rather than during execute.
2019-10-18 07:55:14 -07:00
Peter Johnson
a9f0e46680 Implement sim devices for ADXL345, ADXL362, ADXRS450, Ultrasonic
This makes the halsim_adx_gyro_accelerometer simulation plugin and
the accelerometer part of lowfi_simulation obsolete.
2019-10-05 22:39:00 -07:00
Peter Johnson
aa90645865 Add ability to associate other devices with a SimDevice
Implemented only for AnalogInput, DIO, and Encoder.
2019-10-05 22:39:00 -07:00
sciencewhiz
c58b072c89 Fix Drive usage reporting order (#1908)
Fixes #1893
2019-09-29 20:35:04 -07:00
Tyler Veness
af8ce568d1 Add Ramsete unicycle controller (#1790) 2019-09-29 16:48:12 -07:00
Thad House
cb54602d49 Add support for writing RTR CAN Frames to the CAN API (#1900) 2019-09-28 16:49:34 -07:00
Thad House
9f740e5905 Use OS for serial port instead of NI VISA (#1875) 2019-09-28 16:49:11 -07:00
Prateek Machiraju
457f94ba26 Add trajectory generation using hermite splines (#1843) 2019-09-28 15:40:56 -07:00
Thad House
8858ec55c7 Remove periodic can read call (#1868)
It is not necessary anymore, and is a complicated and confusing API to keep around.
2019-09-28 15:38:58 -07:00
Oblarg
85d42c1993 C++ PIDCommand: Add GetMeasurement() and UseOutput() (#1892)
These are in the Java version but were missed in C++.
2019-09-16 12:53:03 -05:00