This actually isn't a large issue, since the HAL automatically creates a
notifier at the beginning to handle the time rollover, but during
testing without that, I noticed that deleting the last notifier would
disable notifiers for the entire lifetime of the program. This seemed to
be caused by the CLOSEST_TRIGGER static variable not being reset, and
causing new notifiers to never be added to the queue. This fixes that.
Not a bug that can be seen normally, but still a bug.
Change-Id: I6ac61c632918c90972cd0664aa833e3bc9e8c535
Fixes artf4809.
In both C++ and Java, error messages are being sent to both the console
(via stdout/stderr) and being reported via the HAL. We don't want to
remove the stdout/stderr reporting at present because users debugging only
via netconsole (e.g. using riolog) won't see the HAL-reported errors. Until
there's an alternative means to getting the HAL-reported errors to those
users, instead store the previous 5 error messages and don't duplicate them
more often than once per second.
Changes the error reporting from setErrorData() to sendError(), which
improves driver station error reporting. The "location" in C++ is given as
the immediate caller (e.g. the WPILib function). The "location" in Java is
given as the first user function in the call stack. Note the full call stack
is provided in both instances.
Change-Id: I590dd63dcb66825301ebb260aff00cd8d7d501ed
This reverts the previous commit instead fixing it at the root
HALGetJoystickDescriptor function, which also fixes use of that function
by the C++ DriverStation class.
Change-Id: I1f203a015d8f10d119c61635def2822bf124754c
The HALGetJoystick*** methods were not initializing the descriptor
variable properly. This was causing a SegFault if joysticks were moved
around while one of these methods were running.
Change-Id: If804c7ea724b10381765068e4d6fad75fad69ecb
Years update, references to WIND_BASE were removed, and WPILib license was
moved to the root directory of the project.
If there was already a comment block, a year range through 2016 was created
using the first year in the comment. If there was no comment block, a block
with just the year 2016 was added.
Comments were not added to files from external sources (NI, CTRE).
Change-Id: Iff4f098ab908b90b8d929902dea903de2f596acc
This turns accidental parameter mismatches between header and implementation
into compiler errors.
Change-Id: Ic26fabb82b2fd5f79407a11435cdbd35348af15f
This allows both greater than 72 minute (2^32 * 1 us) timeouts and also
gracefully handles notifiers across the FPGA time counter rollover.
Change-Id: Ibde0b903155f60b618b0ca4d5f8f6dd49f90b020
Notifier takes advantage of the multi-notifier support now in HAL.
Each Notifier is now handled by a separate thread at the JNI level, so
one notifier taking longer to process (or being breakpointed) does not
stop the other notifiers from running. These threads are configured as
daemon threads.
In both Notifier and Interrupt JNI, the JNI thread attachment no longer
repeatedly calls AttachCurrentThread(). This improves performance but more
importantly avoids impacting the Eclipse debugger, which attempts to
track each call to AttachCurrentThread() as a separate Java thread.
Note: There is currently no way to free an interrupt handler. Repeatedly
calling attachInterruptHandler() will result in leaking previous handlers.
Change-Id: Ib12e3df88943c03e0269d3906e5b153767139391
- CANJaguar also touched up to report it can't do the new control mode (just like with follower).
- New third optional param for talon c'tor to speed up enable control frame.
- The pulse width routines have been moved to where the script generator puts them. No actual changes there but should help Peter integrate the latest code generator.
Last feature additions for TalonSRX HAL for FRC2015-FRC-2016 season.
-HAL driver uses control_5 frame if firmware supports it. This allows teams to see/confirm control settings taking effect before enabling the robot.
For example selecting the sensor type and going to web-dash to check sensor values now works without having to enable the robot.
-Motion profile HAL routines added. Tested on Single-Speed Double reduction (with slave Talon too).
-Start moving ctre frame defs into a new common header (better then shoving a bunch of struct defs at top of module).
-New child class in CANTalonSRX for buffering motion profile points. Not sure it would be best to leave it as is or make another module. It's trivial now so I thought that was acceptable, (in future it will likely possess compression strategies => no longer trivial).
Change-Id: I803680c1a6669ca3f5157d7875942def6f75b540
Also fix DigitalGlitchFilter usage reporting for C++ (only report on
construction rather than on each call) and add for Java.
Change-Id: I73758b16d81c40442c4acec43e0aa6804b2ba250
The previous commit missed the MindsensorsSD540 value.
Remove wpilibc/Athena/include/NetworkCommunication/UsageReporting.h copy; it
was not actually used (all references except the one in DriverStation.cpp
had been commented out), and has been superseded by the one in HAL.hpp.
Change-Id: I51e2eafa85ee5e40050d702aa0bf69171e887a60
HalDesktop is not nessecary right now, and it breaks the mac build
This will be revisited once the NI Driverstation is needed for sim
Change-Id: I2c665d0abfaeee3b9d20d4d8aad8d4eed8a7b38b
This is a poor man's version of the multi-instance Notifier support in
the higher level languages. It's intended primarily so that notifiers
can be created internal to the HAL.
One benefit of this change is that the current FPGA timestamp is passed
as the first parameter to the ProcessQueue function (rather than the
useless interrupt mask).
Caution for other languages wrapping the HAL: this adds a parameter to
initializeNotifier().
An atexit hook is used for safe cleanup at program termination.
Change-Id: I782b3a74c10215588ae9b7191906fb4186a81028
- Add an atexit hook to set global and watchdog to nullptr.
- Add checks to HAL functions for these nullptrs (also good checks if they
are called prior to HALInitialize).
Change-Id: I138657e8279ed9289648a91c91091ea6a1eb5dcc
Implement GetAllSolenoids in the HAL so that SolenoidBase doesn't have to
read each solenoid individually.
Change-Id: I85559565949f7a7119ead410187235636a63f0ed
Having the HAL take a NATIVE_MULTIWAIT_ID without any way to get that
structure from extern "C" code is a problem. This makes it so it just
takes a MULTIWAIT_ID, and then grabs the native handle inside the HAL.
Change-Id: I06da18ba34adcea2f16e4e53da672f38be79e28e
Signed-off-by: Dustin Spicuzza <dustin@virtualroadside.com>
In the current HAL, once the port structures were created, there was no
way to free the structures. The way the C++ libraries were written this
wasn't a problem, since it grabbed a copy of each and stored them in an
array on bootup. However java does not do this, and grabs new ports
every time an object is created. This causes memory leaks if an object
is ever disposed in java. The same thing looks to be happening in
python, and C# does it too currently, but that would change if this gets
merged.
Adds java memory management fixes
Adds memory management to AnalogInput and Analog Output C++
SolenoidPorts and Digital Ports are all hold static arrays with their
port pointers (although solenoid overwrites them if a new solenoid on
the same module is created), however analog always grabbed new pointers.
I would fix the solenoid one, but I don't know what the ideal way to do
it would be.
Silently ignores free(null) calls by checking passed parameter is non-null.
Change-Id: Id32993b57b53f896e46e55c97541d3bd90b52648
New functions were added to CanTalonSRX in the HAL, however they were
not added to the C side of the library.
Change-Id: I15197e5dce5db0f5ff207d1318c21be485c90741
All other HAL functions have status as the last parameter, only PDP did not.
This changes makes the PDP parameter order consistent with the rest of the HAL.
Change-Id: I725e33f75deab34e6a83b7048b2d6c365fa56a21
This is a major restructuring of the WPILib repository to simply build
procedures and remove the remnants of Maven from everything except the
eclipse plugins. Gradle files have been largely simplified or rewritten,
taking advantage of splitting up parts of the build into separate build
files for ease of reading.
The eclipse plugins are now in a separate project, as is ntcore. All
dependencies are resolved via Maven dependencies, with the
Jenkins-maintained WPILib repo. Project structures have also been
simplified: we no longer have separate subprojects inside wpilibc and
wpilibj. Where possible, these changes hav been done with git renames,
to make sure we still have full history for all repositories. Other
unrelated subprojects have also been broken out: OutlineViewer is now a
separate project.
Change-Id: Ib4e2a6e1a2f66427a14f16612b0e0d69ed661878
Rebuilt last SRX-related commit with latest checkout.
Change-Id: I9f10418580275dae5cd07d740d401d45ee44e276
C++: Added Magnetic Encoder sensor types
C++: API for changing status frame rates updated to use paramEnums.
C++: Added Setting nominal and peak outputs for closed loop modes.
C++: Added current-closed loop
C++: added vcomp mode
C++: Added unit scaling (rotations and rpm)
C++ Added allowableclosedlooperr
C++: Added auto zero position on index pin
C++: Added pulse width decoder API
C++: Added multiplicands in status frames, increasing the max reported pos and max rpm.
C++: Added SetClosedLoopOutputDirection() for reversing slave output and reversing single-direction closed loopoutput.
C++: Added generic ConfigSet and ConfigGet for future flexibility/features.
C++: Added IsSensorPresent
Java: Added Magnetic Encoder sensor types
Java: Added unit scaling (rotations and rpm)
Java: Added current-closed loop
Java: added vcomp mode
Java Added allowableclosedlooperr
Java: Added auto zero position on index pin
Java: Added pulse width decoder API
Java: setForwardSoftLimit and setReverseSoftLimit takes double instead of int so underneath we can support rotations instead of native units.
Java: Added generic SetParam and GetParam for future flexibility/features.
Java Added isSensorPresent
Change-Id: I800251510e411624dce5ee10272606c31764b8ab
If a lock is used with a mutex that doesn't need to be unlocked again before the lock is destroyed, std::lock_guard can be more efficient than std::unique_lock due to less overhead.
This commit also removes a redundant set of curly braces in PIDController.cpp intended to constrain a lock's scope.
Change-Id: Idd692ce439528ddb319a4c62c40c7351a664eb97
Change-Id: If2218df082bca93d25b88088696d6c2897732efd
Adding FRC Local new mdns name
Change-Id: I53d206879663b96009ba3a12de161b7a425ffd10
Adding rpath for new libstdc++
Change-Id: I0c022efb0b15f094d153b44f60215ca00d5f1924
builds two libraries, Athena and Desktop.
Simulation should use Desktop, Robots should use Athena
Also:
- copied Driverstation and Joystick from Devices into Sim
- Descreased dependency of pthreads in JNI.
- removed Simulation ifdef from non simulation
- added missing decprecated attribute for msvc
- removed usage reporting from sim
- removed unused pom.xml and constexpr
Change-Id: If8eb540f9434dce17c77a245fda6985713e80b2d
verified to work on real robots
adds sim eclipse plugins, fixed JavaGazebo, made wpilibC++Sim build on windows
- Java and C++ simulation robot programs run on windows
- simulation eclipse plugin delivers models and gazebo plugins
- Java Gazebo now respects GAZEBO_IP variables and can work across networks
- hal and network tables win32 hacked to work on windows
- smart dashboard broken on windows due to network tables hacks
- wpilibC++Sim, gz_msgs, and frcsim_gazebo_plugins build with CMake
- removed constexpr for cross platform compatibility
- msgs generated using .protos as a part of build process
- some spare and unused cmake/pom files deleted
- simulation ubuntu debians removed entirely
- refactored CMake project flags and macros
- updated to match non-sim C++ API
- fixed and updated documentation
- servo added to simulation
Change-Id: Ia702ff0f1fee10d77f543810ad88f56696443b05
Several ctre headers were in source directories but were required by other
headers in include directories. This worked in gradle but not in cmake.
Change-Id: I806c76031b396d1694a18b8e30c705e92f617a66
This both disables the CANTalon in the CANTalon class (which
should be redundant) and stops sending control signals in the
CanTalonSRX hal class.
Change-Id: I63d6a9d016c221e385d5d5a3679d854882ac6650