mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +00:00
Added Omar's new CanTalonSRX code.
I also updated the C++ and Java code some. For C++, this meant making it compile and adding in the framework for the closed-loop control of the motor. For Java, I updated the JNI bindings with SWIG and created an GetTemperature accessor function to demonstrate how to use the accessors because swig does funny stuff with pass-by-reference functions. Change-Id: If51bf61d0a9bc65a8d497f8d91a5be8d6ff4fdcc
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -3,5 +3,9 @@
|
||||
#include "ctre/CanTalonSRX.h"
|
||||
%}
|
||||
|
||||
%include "cpointer.i"
|
||||
%pointer_functions(double, doublep);
|
||||
%pointer_functions(int, intp);
|
||||
%pointer_functions(float, floatp);
|
||||
%include "CtreCanNode.h"
|
||||
%include "CanTalonSRX.h"
|
||||
|
||||
@@ -3,3 +3,7 @@ for the CAN Talon stuff using swig. This whole directory is a temporary measure
|
||||
until I (James Kuszmaul--11/18/2014) or someone else figures out how to
|
||||
integrate the swig stuff into the build system. For now, all the generated JNI
|
||||
bindings are checked into git, so that it should work until someone goes and updates ctre/CanTalonSRX.*
|
||||
|
||||
In order for this to work, I had to change the CanTalonSRX constructor to take a int deviceNumber instead of a uint8_t.
|
||||
|
||||
Also, in all the SWIGTYPE* files, you must change protected methods to public functions.
|
||||
|
||||
@@ -14,4 +14,5 @@ swig -c++ -package edu.wpi.first.wpilibj.hal -java CanTalonSRX.i
|
||||
# Stick generated files into appropriate places.
|
||||
cp CanTalonSRX_wrap.cxx ../lib/CanTalonSRXJNI.cpp
|
||||
mv CanTalonJNI.java ../../wpilibJavaDevices/src/main/java/edu/wpi/first/wpilibj/hal/
|
||||
rm CanTalon.java # useless file.
|
||||
cp *.java ../../wpilibJavaDevices/src/main/java/edu/wpi/first/wpilibj/
|
||||
|
||||
Reference in New Issue
Block a user