Commit Graph

118 Commits

Author SHA1 Message Date
Peter Johnson
397a296e25 Add a .controllable key as a standard part of Sendable (#1225)
This indicates whether or not the Sendable listeners are installed.
It is set to true when SendableBuilder.startListeners() starts the listeners,
and set to false when SendableBuilder.stopListeners() stops the listeners.

This allows dashboards to choose to change their widget display based on
whether or not the value is actually controllable.
2018-07-28 10:42:31 -07:00
Thad House
1d9ed8f458 Fix SensorUtil issues (#1194)
C++ PDP was missing module check, and channel check called module.
Java docs said 1 based instead of 0 based.
2018-07-28 09:51:49 -07:00
Tyler Veness
d54c2665dc Update UsageReporting enums and their uses for 2019 (#1218) 2018-07-25 19:58:05 -07:00
Tyler Veness
d89b7dd412 Move CameraServer and WPILib headers into their own folder
The old headers were moved into folders because doing so avoids polluting
the system include directories.

Folder names were also normalized to lowercase.
2018-07-22 19:40:57 -07:00
Jeremy White
85118a023d Minor fixes required to enable the simulated robots to run (#1181)
* Fix bugs in PacGoat Java example that prevent it from working.

We have conflicting ports in use, each of which causes a crash
at startup.  These changes fix those issues.

* Change to avoid a crash in Visual C++ when running simulated code.

Without this change, we would get a crash in SendableRobotBase when
constructing a Twine from the 'kOptions' constant string;
we'd get an unable to access memory exception.
2018-07-22 00:58:42 -07:00
Thad House
fe5d7dd6ba Move DS caching from user level to the HAL (#1143)
Also switch eventName and gameSpecificData to fixed 64-byte arrays to avoid mallocs and
extra NetComm calls.  This behavior matches 2018 LabView.

The DS caching is kept in Java to avoid JNI and/or massive amounts of allocations.
This does not increase latency because Java still only hits NetComm once.

Moving the DS caching benefits all languages other than Java, because it avoids the need
for individual implementations.  If caching is ever added to NetComm, it will then only be
necessary to remove it from the HAL and Java rather than all languages.
2018-07-18 22:22:41 -07:00
Thad House
89d15f061b Fix main function initialization (#1176)
I don't have a good way to ensure this always works, so this is going to be a documentation issue.
But initializeHardwareConfiguration is now reentrant, so we can just have all tests call it.
2018-07-08 15:41:31 -07:00
Austin Shalit
3eae079db4 Add PDP usage reporting (#1167) 2018-06-24 23:48:22 -07:00
Tyler Veness
a818c7fd47 Add loop timing to IterativeRobot and TimedRobot (#781) 2018-06-24 00:29:21 -07:00
Tyler Veness
b7807bf9d2 Clean up Command container iteration code (#73) 2018-06-23 17:41:45 -07:00
Tyler Veness
212f378d08 Replace globalError in ErrorBase with a global set of all errors (#615) 2018-06-18 00:13:28 -07:00
Thad House
056e68f2ae Use new CAN API for PDP (#1081) 2018-06-07 22:31:26 -07:00
Tyler Veness
8c680a26f8 Moved C++ comments from source files to headers (#1111)
Also sorted functions in C++ sources to match order in related headers.
2018-05-31 20:47:15 -07:00
Thad House
86c1f8ae50 Fixes initialization when not using the provided main (#1085)
Helpful for simulation, which might not use our main.
2018-05-24 20:03:19 -04:00
Tyler Veness
ecfe95383c Made SensorBase a utility class and renamed it to SensorUtil (#813) 2018-05-23 23:22:30 -04:00
Peter Johnson
a2ecb1027a Update LLVM to latest upstream. (#1080)
Also change header guards to WPI header guards.
Remove StringRef::c_str() customization, replacing the handful of uses with Twine or SmallString.
TCPStream: Include errno.h and make Windows includes lowercase for consistency.

Upstream LLVM version: eb4186cca7924fb1706357545311a2fa3de40c59
2018-05-22 23:31:08 -07:00
Thad House
680aabbe7c Add new CAN API (#1036) 2018-05-21 16:09:38 -07:00
Tyler Veness
df182f382e PIDController now supports composition (#976)
For example, an outer position feedback controller can now drive the
reference of an inner velocity feedback controller.
2018-05-19 01:32:43 -07:00
Austin Shalit
17401e10f0 Add setting to invert the right side of the drive (#1045) 2018-05-19 01:22:20 -07:00
Tyler Veness
72a79aac53 Fixed the names of the arguments to some C++ drive classes (#1070)
The docs already have the correct name, but some headers and sources
weren't updated. Java doesn't have this mistake.
2018-05-16 19:55:27 -07:00
Tyler Veness
64b03704f8 Rename Joystick default channel constants (#904)
The new naming makes it more clear that the constants are intended to be used
with the channel setters.
2018-05-16 19:53:16 -07:00
Tyler Veness
630fc55bde Implemented synchronous PID controller (#993)
SynchronousPID provides a Calculate() function for teams to call themselves
instead of running the controller with a Notifier.
2018-05-16 19:51:37 -07:00
Austin Shalit
f90e429bf9 Add removeAll to preferences (#987)
This removes all keys except for .type.
2018-05-16 19:50:35 -07:00
Tyler Veness
ef442d775d Refactored DriverStation.java unplugged message handling to match C++ (#808)
Also fixed error handling in C++ for out-of-bounds arguments.
2018-05-16 00:13:52 -07:00
Thad House
ab70220ecf Makes SPI edge changes more obvious (#1056)
Rising and Falling mean the opposite when active is set high vs low. Leading and trailing makes much more sense.

Closes #925
2018-05-14 18:16:36 -07:00
Tyler Veness
6729a7d6b1 Run wpiformat on merged repo (#1021) 2018-05-13 17:09:56 -07:00
Austin Shalit
665a6e356a Allow users to feed the watchdog contained in drive objects (#1044) 2018-05-09 20:18:55 -07:00
Peter Johnson
f84018af5f Move entirety of llvm namespace to wpi namespace.
During shared library loading, a different libLLVM can be pulled in, causing
llvm symbols from dependent libraries to resolve to that library instead of
this one. This has been seen in the wild with the Mesa OpenGL implementation
in JavaFX applications (see wpilibsuite/shuffleboard#361).

This is clearly a very breaking change. For some level of backwards
compatibility, a namespace alias from llvm to wpi is performed in the "llvm"
headers.  Unfortunately, forward declarations of llvm classes will still break,
but compilers seem to generate clear error messages in those cases
("namespace alias 'llvm' not allowed here, assuming 'wpi'").

This change also moves all the wpiutil headers to a single "wpi" subdirectory
from the previously split "llvm", "support", "tcpsockets", and "udpsockets".
Shim headers will be added for backwards compatibility in a later commit.
2018-04-30 10:22:54 -07:00
Tyler Veness
93859eb84f TimedRobot now uses the Notifier HAL API (#942)
Fixes #941.
2018-04-30 00:00:09 -07:00
Thad House
7f88cf768d New 2018 and later build setup (#1001) 2018-04-29 13:29:07 -07:00
Thad House
14228d82f3 Adds Direct port name Serial API (#956) 2018-03-05 19:41:09 -08:00
Peter Johnson
5175829bab PWM: Use getRaw and setRaw for Sendable "Value" property. (#963)
Also change type to "PWM".  Move old PWM Sendable behavior for both value
and type to PWMSpeedController.
2018-03-03 21:36:25 -08:00
Peter Johnson
9d7293734a SendableChooser: Do not automatically add to LiveWindow. (#964)
SendableChooser::InitSendable() is written such that it saves the table
being used in an instance variable.  This doesn't work if the chooser is
added to both LiveWindow and SmartDashboard.  Normally it is not added to
LiveWindow because the name is empty, but if setName() is called this could
still happen.  Note adding the same SendableChooser to SmartDashboard with
two different names is also not currently supported, for the same reason.

The correct solution will be to remove the instance variable, but this is
too high risk to implement mid-season, so instead just remove from LiveWindow.
2018-03-03 21:34:42 -08:00
Tyler Veness
7bb3e4efc3 Made documentation for RobotDriveBase::SetDeadband() clearer (#953)
It now mentions that the deadband is applied to the drive inputs.
2018-03-03 01:57:59 -08:00
Sam Carlberg
77d6c11743 Invert right side motors in MecanumDrive sendable (#933)
This aligns with the current behavior of DifferentialDrive
Fixes shuffleboard#404
2018-02-09 08:30:12 -08:00
Tyler Veness
64a7e57fe0 Added output normalization to DifferentialDrive::CurvatureDrive() (#924)
This normalizes within -1..1 to avoid clipping and maintain the ratio between
wheel speeds, since that ratio determines the center of rotation.

Fixes #923.
2018-02-01 21:17:04 -08:00
Tyler Veness
5ca00dddbe Added TimedRobot::GetPeriod() (#915)
Fixes #914.
2018-01-27 01:01:15 -08:00
Tyler Veness
120ceb3427 Fix channel reassignments for C++ Joystick twist and throttle axes (#903) 2018-01-26 17:26:10 -08:00
Thad House
48ae6c954a Publishes match specific data and other FMS info to NT (#874)
This is so products like SB can present the current setup.
2018-01-18 23:17:28 -08:00
Thad House
07f70cf784 Fixes control data packet delay (#875)
Because of an expected change in 2018 that didn't happen, we had a race
condition causing a 1 packet delay on all DS values. This fixes that.
2018-01-18 21:54:33 -08:00
sciencewhiz
e4e1eab413 Fix cancel of inner commands in ConditionalCommands (#858) 2018-01-18 20:04:33 -08:00
Nic Hodlofski
0e8ff4663d SpeedControllerGroup: Call set() from pidWrite()
This means pidWrite() now takes m_isInverted into account.
Fixes #887.
2018-01-18 20:03:13 -08:00
Rohit Vighne
59f938b584 Invert when getting motor speed in SpeedControllerGroup (#886) 2018-01-11 22:16:42 -08:00
sciencewhiz
5513888457 Fix PIDController with Continous and no Input Range set. (#883) 2018-01-11 21:06:25 -08:00
Peter Johnson
bb38ef5642 DifferentialDrive: Invert right motor in LiveWindow. (#867) 2018-01-02 21:15:15 -06:00
Sam Carlberg
ee33296e1f SmartDashboard override .name entry in putData(String, Sendable) (#866)
Fixes #865
2018-01-02 16:39:16 -06:00
Tyler Veness
0ef9803363 Update copyright year to 2018 (#864)
Also fix a few files with incorrect line endings.
2018-01-02 11:20:21 -06:00
Sam Carlberg
8346caed9c Move subsystem command metadata to metadata key format (#863) 2018-01-01 17:05:03 -05:00
sciencewhiz
c647a801ad Add Encoder Index as a child (#857) 2017-12-29 21:48:39 -06:00
sciencewhiz
02131639bc Add Digilent DMC 60 Speed Controller (#855) 2017-12-28 21:42:19 -06:00