Commit Graph

79 Commits

Author SHA1 Message Date
Patrick Plenefisch
29e54a9899 Adding path back in for OS X toolchains because of Apple lockdown
Change-Id: Ia7a76172b8d5d3996556328a00ecc73ca84f5774
2015-10-05 11:09:01 -04:00
Patrick Plenefisch
9f859234fb Update for latest image, not sure about ctre folder so leaving
Change-Id: If2218df082bca93d25b88088696d6c2897732efd

Adding FRC Local new mdns name

Change-Id: I53d206879663b96009ba3a12de161b7a425ffd10

Adding rpath for new libstdc++

Change-Id: I0c022efb0b15f094d153b44f60215ca00d5f1924
2015-09-30 06:03:56 -07:00
James Kuszmaul
f65e697107 Revert changes preventing old user code from compiling.
I'm not 100% sure whether we want these, but they are a quick
find and replace to do.

Basically, there are two primary things that we have done
this summer that break existing user code:
-Changing GetInstance() calls to return references instead
 of pointers. This forces users to change from doing something
 like LiveWindow::GetInstance()->AddSensor() to LiveWindow::GetInstance().AddSensor().
-Making PIDGet() and related calls const, forcing users to change
 the function signatures wherever they override them.

The GetInstance() calls don't really matter to me either way,
especially since there are no real ownership issues going on there,
unlike the rest of the smart pointer-related changes.

For the const stuff, it is certainly more correct to mandate that
user PIDGet() functions be const and the such, but at the same time,
I'm not sure that there is any strong need for it, and the errors
generated are not the most helpful. While this wouldn't necessarily
be an issue for more experienced teams or completely new teams (who
don't have any old code to be reusing), it may cause issues for more
average teams who aren't familiar with the intricacies of C++ anything.

Change-Id: I6e7007982069292ea70e6d0fc8ca40203340df1b
2015-09-16 19:10:01 -04:00
peter mitrano
29d029fa61 merged from frcsim branch
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
2015-08-18 10:39:25 -04:00
James Kuszmaul
e017f93f16 Fixed examples to build/run with new WPILib versions.
Also added some references/smart pointers to a couple places
that seemed convenient to the user.

I haven't updated the constructors for RobotDrive() related
examples, pending the results of gerrit change https://usfirst.collab.net/gerrit/#/c/960/

A few things that we are noticing:
--It might be nice if ReturnPIDInput() didn't have to be const;
  when people try to override it, they have to remember to put
  the const in and if they don't, then the compiler error isn't the
  most obvious (especially since this is a change). This would also
  apply to PIDGet() in the PIDSource interface.
--SendableChooser still takes raw pointers. This could lead to an
  issue I had to debug briefly where you accidentally call
  GetSelected() on autoChooser and put the resulting raw pointer
  into a unique_ptr, which destroys the pointer when it goes out of
  scope. Specifically, I was testing the PacGoat example and
  I ended up with a situation where if auto mode was run once, it
  was fine, but if it was run twice, the selected command would
  have been destroyed by the unique_ptr. I believe that this
  just requires updating SendableChosser to take shared_ptr.
--When the samples are compiled with -pedantic, it points out that
  START_ROBOT_CLASS macro expansion results in a redundant semicolon.

Change-Id: Ib4c025a61263d0d2780d4253faa31713e15333a5
2015-08-13 11:26:28 -07:00
James Kuszmaul
534ea134a4 artf4154: Get rid of raw pointers in C++.
This deals with the majority of the user-facing code
in wpilibC++Devices and a substantial portion of it in
wpilibC++. wpilibC++Sim and wpilibC++IntegrationTests
are untouched except where it is necessary to make them
work with the rest of the libraries.

There is still a lot to do in the following areas:
-The HAL (which we may not want to touch at all).
-The I2C, Serial, and SPI interfaces in wpilibC++Devices,
  which I haven't gotten around to doing yet.
-Most wpilibC++Devices classes have void* pointers
  for interacting with the HAL.
-InterruptableSensorBase passes a void *params for
  the interrupt handler.
-I haven't converted all the const char* to std::strings.
-There are plenty of other cases of raw pointers still
  existing.
-This doesn't fall directly under raw pointer stuff,
  but move syntax and rvalue references could be introduced
  in many places.
-I haven't touched vision code.
-The Resource classes conflict (one is in the hal, the other
  in wpilibC++). Someone should figure out a more
  permanent fix (eg, just renaming them), then doing
  what I did (making a new namespace for one of them,
  essentially the same as renaming it).

A few other things:
-I created a NullDeleter class which is marked as deprecated.
  What this does is it can be passed as the deleter to a
  std::shared_ptr so that when you are converting raw pointers
  to shared_ptrs the shared_ptr doesn't do any deletion if
  someone else owns the raw pointer. This should only be
  used in making old raw pointer UIs.
-I had to alter the build.gradle so that it did not
  emit errors when deprecated functions called deprecated
  functions. Unfortunately, gradle doesn't appear to be
  actually printing out gcc warnigns for some reason.
  The best way I have found to fix this is to patch
  the toolchains (https://bitbucket.org/byteit101/toolchain-builder/pull-request/5/make-gcc-not-throw-warnings-for-nested/diff)
  so that a deprecated function calling a deprecated
  function is fine but a non-deprecated function calling
  a deprecated function will throw a warning (which we
  then elevate with -Werror). I believe that clang
  deals with this properly, although I have not
  tried it myself.

Change-Id: Ib8090c66893576fe73654f4e9d268f9d37be06a2
2015-07-20 13:18:29 -04:00
Joseph
2c392d1813 Fixed comment problem in GyroMecanum cpp and made other small fixes to sample
programs.

Change-Id: Id6ee60085fa369ce3eb2e8261c0352b24886e2ae
2015-06-26 09:39:36 -04:00
Joseph
ae90e5f6d3 Added new sample programs to the eclipse plugins for C++ and Java.
Modified examples.xml for the corresponding added programs.

Change-Id: I3d86c570f446ec8cf3013c58dd94215f2907bbb1
2015-06-25 14:31:51 -04:00
Joseph
c357d1dcae Added Ultrasonic example program in Java and C++, updated examples XML.
Change-Id: I510bef33d8565d124894d926d6634b04b1b6ca28
2015-06-24 16:30:55 -04:00
Kevin O'Connor
5a094879b6 Add DisabledInit to C++ Command Based template. Move and modify comment on Java version. Fixes artf3840
Change-Id: I2371fc9cf64588e38f35b17715773604df6c2392
2015-06-02 10:00:34 -04:00
Kevin O'Connor
9b7042a51a Fix errors in Vision examples.
Change-Id: I752a99ff7b8872a0fc8926e3633c2b521383bbd0
2015-01-16 15:35:48 -05:00
Kevin O'Connor
91ccc5d10b 2015 Color and Retroreflective vision samples for C++ and Java
Change-Id: Id95925ced100b25d591c40995bb016780737312d
2015-01-14 12:45:17 -05:00
Alex Henning
05cd0627b2 Update to point to Gazebo3.2 header location.
Change-Id: Ifebb31a375e8b7a6136115748c3634757fb732b8
2015-01-02 18:34:35 -05:00
Joe Ross
0368322385 Update Camera templates to make C++ and Java more similar.
Include delays and template code from other examples to show how to use
these examples in a full robot program. Change Java example in example
finder to Simple Vision to match C++. Add comments about how to find cam
number and change default to cam0.

Change-Id: I85846ccfaf016c538a750b057a7fd766cdff9447
2014-12-29 13:48:11 -05:00
Brad Miller
32f3bea465 Axis camera C++ example program
Change-Id: I60a14ce91fc09831b497ccdaaa7bb1bb26c8d945
2014-12-28 15:47:08 -05:00
Kevin O'Connor
04f9ca4feb Change vision defaults from "cam1" to cam0". Add some error reporting to Intermediate Vision example
Change-Id: If0bb60611c6c5e6f2411ad5d0432c712b24efb24
2014-12-12 15:08:07 -05:00
James Kuszmaul
4833316571 Added more Talon SRX documentation and PID samples.
Change-Id: I2b1326c11452c6895846ded1277dbf4d38a5222d
2014-12-05 17:21:36 -05:00
Brad Miller
a9d30c0389 Fixed a typo in the SRX sample project to correct a variable name error
Change-Id: I68f9cf33062bf2ef5df88247af8a5ee470a28d77
2014-11-28 11:07:08 -05:00
Brad Miller
c00d9f1523 Updated the names and descriptions for the c++ vision examples
Change-Id: I7f4e72ddd3e5f5ad20012ed81bd74fa5373e0ebd
2014-11-26 14:26:32 -05:00
Brad Miller (WPI)
020d97580a Merge "Fixed bug with SDFormat version changing." 2014-11-26 09:01:36 -08:00
James Kuszmaul
28a41e4ac2 Added support for CAN Talon SRX in C++ and Java.
Currently, the JNI bindings are generated by Swig and, unfortunately,
  the interface available through Java is lower-level than that for C++
  (ie, direct access to the ctre code through the JNI bindings, rather
   than an interface on top of that), but it does work.
See eclipse plugins for some short samples.
There are a couple of short unit tests as placeholders.
Still needs some cleaning up.

Change-Id: Iae2f74693ca6b80bf7d5aca0625c66aa6e0b7f85

Added quick samples for C++/Java CAN Talon stuff.

Change-Id: I3acb27d6fd5568d88931e0d678c09973d436735d
2014-11-26 11:55:37 -05:00
Joe Ross
c98f54dbbc match templates with robot builder.
Change-Id: Iedb8b9efc58ca73bc654b119d5d1aed5b4eb5553
2014-11-26 07:41:56 -08:00
Alex Henning
e86312cd6f Fixed bug with SDFormat version changing.
Change-Id: Ia2d17fc60763678ad4971d108861988157537fc3
2014-11-20 16:07:00 -05:00
Brad Miller
4ad8818a8a Added vision samples
Change-Id: Ieb482d072ae15817be40477f187f081c9f7fe19f
2014-11-19 19:39:35 -05:00
Kevin O'Connor
4be9732e9c Moves C++ global build properties to properties file to match Java.
Adds host reachability check and static IP fallback
Adds roboRIO Image check
Adds JRE check for Java

Change-Id: I07f3a0863bde0ebec7e7d8f48270e45758bddba5
2014-11-19 09:20:35 -05:00
Thomas Clark
6f4d6ed998 Add support for vision in C++
Add IMAQdx and its dependencies

Change-Id: I6befa563e96db224db83fb90985c86eb3e8d4f3e

Add a "CameraServer" class for C++

This class allows the driver station's camera viewer to interact with
a C++ program.  It includes both an automatic mode to send images from
a webcam to the dashboard in a background thread, and an option to
manually feed it IMAQ images.

Change-Id: I54fdb164c00dce165859c22f435be647dc9927cc
2014-11-16 13:06:49 -05:00
Brad Miller
c883c9e2fc Removed release configuration from template (fixes artf3688)
Change-Id: I4e6d1abc68f23f870911b7d871b5a835cc26afef
2014-11-12 15:41:55 -05:00
Brad Miller (WPI)
eb536ba340 Merge "Added default world files to examples." 2014-11-12 11:40:13 -08:00
Brad Miller
1d0a6b8ace Fix all the samples to build with the C++11/14 language features (constexpr) 2014-11-11 09:15:46 -05:00
Alex Henning
08fdf45f6e Added default world files to examples.
This saves a step and prevents one of the biggest user errors with the
pacgoat example.

Change-Id: Icdceb1da37c4b456f1a34daa815f3bbe2a47e18e
2014-11-09 14:26:23 -05:00
Brad Miller (WPI)
cd3db9631e Merge "Move user program to home\lvuser based on comments from Joe" 2014-11-05 05:23:22 -08:00
James Kuszmaul
767686ae2e [artf3717] Added isEnabled to Teleop Loops in Samples.
Anywhere in the sample programs where there was just a
isOperatorControl() in the while loop for Teleop, added an "&&
isEnabled()".

Change-Id: Ib81e8bab79923e262c314a073a591855cbf06846
2014-10-27 15:55:47 -04:00
Kevin O'Connor
8c395ca292 Move user program to home\lvuser based on comments from Joe
Change-Id: I289cfb4603a4ead6641161191129cb5ca0ea9858
2014-10-27 13:43:07 -04:00
Brad Miller (WPI)
5b2520c35f Merge "Fixed building of the frcsim-libwpilibsim-cpp deb." 2014-10-27 09:40:22 -07:00
Alex Henning
fa8d7b843c Fixed building of the frcsim-libwpilibsim-cpp deb.
There is still a bug where the examples have been updated to use 0 based
joysticks, but the simulation libraries have not been updated. I'll fix
that as a separate commit focused on fixing the joystick APIs.

Change-Id: I3b358e67b7fa18b30d1fd2b53098659cfefdfd76
2014-10-26 20:43:50 -04:00
James Kuszmaul
20c60a5fe6 Added C++ Encoder samples to Eclipse Plugin.
Reads values from quadrature encoder and displays them on the
SmartDashbord.

Also added Encoder with Motor Control example, which is identical to the
Motor Control sample but displays an encoder value on the
SmartDashboard.
2014-10-24 16:01:11 -04:00
James Kuszmaul
9af070a4af Added C++ sample for CAN monitoring of PDP.
Uses CAN to monitor PDP and displays values on the SmartDashboard.

Change-Id: Icb06fec0b65ce02b7c396e7d4e379cee0d959095
2014-10-23 10:07:53 -04:00
James Kuszmaul
3abd352be9 Added sample programs for Solenoids and Relays.
Added a sample program to the eclipse plugin which uses joystick buttons
in Operator Control mode in order to control the output of a single and
a double solenoid.
Also added a sample program which uses joystick buttons to control a
spike/Relay.

Bonus: The title on the window that you get when you are opening a sample in
C++ said "Java" instead of "C++". Fixed now.

Change-Id: I0d01c23003d1fba2dbb08cbe6977ec886d97a22f
2014-10-22 09:34:52 -04:00
James Kuszmaul
311a690262 Added sample program for Motor Controller.
Sample uses joystick output to directly control a motor controller.
Added to C++ eclipse plugin with in same way as Java MotorControl
sample.

Change-Id: I7ce36b8000fbeb94e637a820f82399462b1416e5
2014-10-21 10:03:02 -04:00
Kevin O'Connor
f99b57b1fe Run the scheduler in disabled (fixes artf3631)
Change-Id: Ib1614e2c96b4cda580110ea427398bcfe2ff6fbe
2014-10-15 15:32:38 -04:00
Patrick Plenefisch
591e1de721 use WPILIB eclipse var & use luna to build
Change-Id: I5e8560329226fca3c60f337b6b4744c50a09cdc9
2014-10-08 10:39:06 -04:00
Brad Miller
2f26361398 Added Mecanum drive sample program
Change-Id: I0538c21116cd6c8836f76b6d4446b83d8723a20f
2014-10-05 16:03:36 -04:00
Patrick Plenefisch
244ecd23ee Too many bugs with LTO in GCC 4.9 & Binutils 2.24. Disabling. Maybe later.
Change-Id: Id10ebb9768743e5f852275ae1f1d7a80094c99ed
2014-10-02 23:15:50 -04:00
Brad Miller
8b806e11e2 Added Arcade C++ example and a hierarchy for C++ examples.
Change-Id: I31094dd4f158345103628aacd7de3cb86f27c483
2014-10-02 14:42:24 -04:00
Brad Miller
1cef27134e Changed joystick port numbers to be zero-based for C++ and Java.
Change-Id: Ifd55e8654be3b15abbe7460d2e9e6fff8acd9977
2014-10-01 11:25:51 -04:00
Patrick Plenefisch
fa4a39dcc6 Initial linker script to abstract away the massive library list
Change-Id: Iada981fc9d50c640d4c519f5024f48f6b3df7433
2014-09-25 17:13:37 -04:00
Patrick Plenefisch
21f728c802 Moving to arm-frc-linux-gnueabi in cproject and attempting to use gdb (overwritten)
Change-Id: I7dd5017f461bbff82c5ed6f64842880e4f0a44c9
2014-09-23 22:19:43 -04:00
Patrick Plenefisch
1f35670a18 Enabling C++14 and removing path for new toolchains
Change-Id: I248d27cceeb16fd2b5690a9637245c7451f2c527
2014-09-23 15:23:48 -04:00
Patrick Plenefisch
d1d81e5e19 Remove unnecessary config for cproject/Simulate target
Change-Id: I5576959974bede623fb0fe267f0d8b163124c2c9
2014-09-23 15:20:45 -04:00
Patrick Plenefisch
8199fb28d8 Updating template .cproject to avoid specifiyng commands and defaults
Fixes unknown GCC errors (supposedly)

Change-Id: I7688b8cd66f8ea70195a7e60500e212766415eb2
2014-09-21 16:38:42 -04:00