Peter Johnson
e127bac7fd
[sim] Properly initialize AnalogTrigger ( #2646 )
2020-08-19 21:58:07 -07:00
Peter Johnson
dc9e560f9b
[sim] Add callback for NotifyNewData
2020-08-15 13:47:30 -07:00
Peter Johnson
ae5b07ba01
[hal] Add stubs for sim joysticks and match info on Rio
2020-08-15 13:47:30 -07:00
Peter Johnson
ad817d4f23
[sim] Map wpi::Now() to simulated FPGA time ( #2631 )
...
This matches on-robot behavior for things like NetworkTables timestamps.
2020-08-06 23:03:42 -07:00
Peter Johnson
1b8ceb36fc
[sim] Add callbacks for joysticks and match info ( #2628 )
2020-08-03 22:38:48 -07:00
Peter Johnson
5cf4c16f5b
[wpilibj] Suppress serialVersionUID warnings ( #2618 )
...
These are all classes (e.g. Exception classes) which will never be serialized.
2020-07-26 17:06:17 -07:00
Thad House
a6a71f8c76
[hal] Fix RoboRIO notifier never starting ( #2611 )
2020-07-23 18:09:00 -07:00
Peter Johnson
33d8363297
[sim] Fix HAL notifier race condition ( #2606 )
...
WaitForNotifierAlarm was waiting on the CV without first checking to see if
the exit condition was met.
2020-07-20 23:30:14 -07:00
Peter Johnson
b9feb81226
[sim] Add joystick simulation support ( #2595 )
...
This adds joystick functions to DriverStationSim, and new GenericHIDSim,
JoystickSim, and XboxControllerSim classes.
2020-07-15 00:33:57 -07:00
Peter Johnson
16ef372b53
[hal] Merge WaitForCachedData into WaitForDSData ( #2587 )
...
Remove WaitForCachedData as it's no longer required.
Also properly handle caching / transition detection logic that occurs at the
WPILib level.
This also changes DriverStation::IsNewControlData() to check for WPILib-level
caching instead of wrapping the HAL function.
2020-07-13 21:57:54 -07:00
Peter Johnson
227084e92e
[hal] Implement stub mockdata on RoboRIO ( #2575 )
...
This makes it much more user-friendly to use simulation classes without needing
to ifdef for C++ to avoid linker errors or be very careful about construction
to avoid runtime errors in Java.
2020-07-07 21:49:05 -07:00
Peter Johnson
5bd2dca463
[sim] Move HAL_LoadExtensions to end of HAL_Initialize ( #2571 )
...
Previously, HAL_InitializeDriverStation would reset any callbacks set in
extensions during load.
2020-07-05 22:12:12 -07:00
Peter Johnson
3050e935a1
[sim] Add WPILib-class-taking constructors ( #2538 )
...
When not direct mapped, make index constructors private and add factory
functions for channel and index.
Co-authored-by: GabrielDeml <gabrielddeml@gmail.com >
2020-07-04 10:10:43 -07:00
Peter Johnson
80a1fa9ece
[sim] Add support for disabling SimDevices ( #2568 )
...
This allows disabling/enabling SimDevices via prefix matching. This can be
used to force devices that normally use SimDevice in simulation mode to
instead talk directly to the hardware as in normal operation.
2020-07-04 01:09:49 -07:00
Peter Johnson
1851ba1434
[sim] Remove index from RoboRIO simulation interface ( #2567 )
2020-07-04 00:44:56 -07:00
Peter Johnson
c4b8a2505d
[sim] Add Java wrapper for getProgramStarted ( #2566 )
...
Also move SimHooks to wpilibj (to match wpilibc).
2020-07-04 00:44:37 -07:00
Peter Johnson
c6e6346642
[sim] Support StepTiming() even when timing is not paused ( #2558 )
2020-06-29 21:52:23 -07:00
Vasista Vovveti
dac0e5b133
[sim] Set Windows timer precision to 1ms ( #2557 )
2020-06-28 17:45:40 -07:00
Peter Johnson
ce3bc91946
[sim] Move Sim classes from HAL to wpilibc/j ( #2549 )
...
Also move some things in HAL for consistency.
WAS:
C++:
- C APIs: #include "mockdata/AccelerometerData.h"
- User side class: #include "simulation/AccelerometerSim.h"
Java:
- JNI APIs: hal.sim.mockdata.AccelerometerData (and a few classes in hal.sim)
- User side classes: hal.sim.AccelerometerSim
IS:
C++:
- C APIs: #include "hal/simulation/AccelerometerData.h"
- C++ class: #include "frc/simulation/AccelerometerSim.h"
Java:
- JNI APIs: hal.simulation.AccelerometerData
- User side class: wpilibj.simulation.AccelerometerSim
2020-06-27 22:11:24 -07:00
Peter Johnson
629e8b41f2
[sim] Provide method to set the runtime type ( #2539 )
...
This is needed for extensions that effectively access real hardware and
want to disable the "simulation" parts of user code.
2020-06-26 20:46:13 -07:00
Peter Johnson
71c187a1ed
[hal] Add GetIndex() to handles classes ( #2548 )
...
This provides a lock-free way to get just the handle index.
2020-06-26 19:56:05 -07:00
Peter Johnson
8a80f97c06
[hal] Move JNI helpers and sim namespace to hal namespace ( #2543 )
2020-06-26 17:12:55 -07:00
Thad House
3cbec411c7
[build] Add package declaration check to checkstyle ( #2446 )
...
Co-authored-by: Austin Shalit <austinshalit@gmail.com >
2020-06-26 11:10:34 -07:00
Peter Johnson
62b8a36ce9
[sim] Wrap timing functions in C++ SimHooks ( #2540 )
...
These are present in Java but were missed for C++.
2020-06-20 23:47:55 -07:00
Peter Johnson
1557a4c3b0
[sim] Make SimDeviceInfo/SimValueInfo data members public ( #2531 )
2020-06-13 20:50:34 -07:00
Thad House
cf20b068ca
[sim] Map HAL_GetSystemActive to HALSIM_GetDriverStationEnabled ( #2501 )
...
Vendors have requested this for testing purposes.
2020-05-01 09:05:54 -07:00
Thad House
21aafea098
[hal] Use std::thread for Notifier thread on Rio ( #2152 )
...
This gives us more control over the thread than using the NI manager.
2020-04-03 08:38:00 -07:00
Thad House
3ed2908563
[sim] Add HALSIM accessors for encoder rate and distance ( #2467 )
2020-04-03 08:33:38 -07:00
Thad House
303194b08b
Add missing CAN definition for IO Breakout ( #2394 )
...
Co-authored-by: David Vo <auscompgeek@users.noreply.github.com >
2020-03-22 22:56:07 -07:00
Thad House
7b7f44d937
Use netcomm function to get target class rather then hardcoded ( #2391 )
...
It reports the correct value now, and helps for future proofing
2020-03-14 22:04:12 -07:00
Thad House
6cf89aa0f3
Fix interrupt cancellation ( #2406 )
2020-03-14 22:03:04 -07:00
Thad House
554bda3332
HAL: Expose NetComm SendConsoleLine ( #2337 )
...
This can be use to synchronize writes between threads, assuming writes all go through this and not stdout.
2020-02-18 20:44:40 -08:00
Thad House
2a968df779
Add method for releasing a waiting interrupt ( #2347 )
...
Useful for a new high level interrupt implementation.
2020-02-18 20:41:42 -08:00
Jonathan Noyola
20e6c04059
Fix cmake install of hal generated files ( #2320 )
2020-01-31 19:18:00 -08:00
Thad House
dbe1e6f466
Fix missing SetDutyCycleSimDevice on Rio ( #2274 )
2020-01-15 21:33:35 -08:00
Thad House
fe597eeba1
Fix SPI DIO count for sim ( #2272 )
...
Only 26 DIO were detectable, not 31.
2020-01-15 18:58:14 -08:00
Thad House
bc159a92a7
Default sim voltage to 12v, make user rails active ( #2224 )
2020-01-04 15:07:47 -08:00
Peter Johnson
bc8f68bec7
Add sim HAL_WaitForCachedControlData ( #2221 )
2020-01-03 22:38:45 -08:00
Declan Freeman-Gleason
c4bd54ef44
Add JNI binding to suppress driver station error/warning messages ( #2200 )
...
This is to allow suppressing an ugly stack trace/error message in a unit test in #2197 . It doesn't support the full HALSIM_SetSendError callback stuff (i.e. you can only suppress, not intercept, stack traces with this).
2019-12-27 21:11:26 -06:00
Peter Johnson
7b952d599d
Add usage reporting for many new things ( #2184 )
...
- new CommandScheduler
- kinematics and odometry classes
- new PIDController
- ProfiledPIDController
- TrapezoidProfile (reported in Constraints class)
Also update instances.txt to match latest NI version.
One side effect is that a couple of classes are no longer constexpr.
2019-12-25 00:42:14 -06:00
Thad House
bdc1cab013
Add support for configuring SPI Auto Stall Config ( #2193 )
2019-12-24 12:52:58 -06:00
Thad House
0b80d566ad
Use ChipObject HMB function for LED ( #2173 )
...
It's fixed in v9 and up.
2019-12-14 21:15:32 -08:00
Peter Johnson
b78f115fcf
Work around VS2019 16.4.0 bugs ( #2171 )
...
Work around frontend bug in scoped_lock and code generation bug in reverse_iterator in gtest.
See https://github.com/google/googletest/pull/2635
2019-12-14 10:48:19 -08:00
Thad House
24c031d692
Increase SPI auto byte count to allow 32 bytes to be sent ( #2163 )
...
The FPGA now supports 32 bytes.
2019-12-07 17:18:25 -08:00
Thad House
6b4eecf5fe
Add hidden functions to get the SPI system and SPI DMA ( #2162 )
...
With the addition of stall configuration, its not very clear how it works, and seems like it would be different
per use. So adding ways to manually get them, so the functionality can be figured out how to be used.
2019-12-07 17:16:14 -08:00
Tyler Veness
5c6b8a0f45
Replace std::is_pod_v with std::is_standard_layout_v ( #2159 )
...
The former is deprecated in C++20.
2019-12-07 13:34:52 -08:00
Thad House
d8f11eb149
Hardcode channels for LSB weight ( #2153 )
...
Avoids a mutex and a lookup.
2019-12-06 20:56:40 -08:00
Thad House
b2ae75acd8
Add way to disable "no extensions found" message ( #2134 )
...
We want it enabled by default, but there have been requests for a way to disable it.
2019-12-06 20:55:36 -08:00
Thad House
d003ec2dc9
Update to 2020v9 image ( #2154 )
...
- Fix VISA include and FPGA header
- Fix missing VISA lib from executables
2019-12-04 20:38:43 -08:00
Peter Johnson
8e7cc3fe78
Add user-friendly SimDeviceSim wrappers ( #2150 )
...
This makes unit testing with SimDevice devices much easier.
2019-12-02 23:27:33 -08:00