Skip to content

Commit f113040

Browse files
committed
update headers/libs/cmake to Phoenix 5.18.3
1 parent 50c2fcf commit f113040

File tree

104 files changed

+9874
-2889
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+9874
-2889
lines changed

CMakeLists.txt

+8-2
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,24 @@ add_executable(example ${PROJECT_SOURCE_DIR}/example.cpp)
2323
if (${CMAKE_LIBRARY_ARCHITECTURE} STREQUAL "arm-linux-gnueabihf") # Jetson TK1 / Pi
2424
target_link_libraries(example ${CMAKE_SOURCE_DIR}/lib/raspberry/libCTRE_Phoenix.a)
2525
target_link_libraries(example ${CMAKE_SOURCE_DIR}/lib/raspberry/libCTRE_PhoenixCCI.a)
26-
target_link_libraries(example ${CMAKE_SOURCE_DIR}/lib/raspberry/libCTRE_PhoenixPlatformLinuxSocketCan.a)
26+
target_link_libraries(example ${CMAKE_SOURCE_DIR}/lib/raspberry/libCTRE_PhoenixDiagnostics.a)
27+
target_link_libraries(example ${CMAKE_SOURCE_DIR}/lib/raspberry/libCTRE_PhoenixPlatform_socketcan.a)
2728
target_link_libraries(example ${CMAKE_SOURCE_DIR}/lib/raspberry/libCTRE_PhoenixCanutils.a)
29+
target_link_libraries(example ${CMAKE_SOURCE_DIR}/lib/raspberry/libCTRE_PhoenixCore.a)
2830
elseif (${CMAKE_LIBRARY_ARCHITECTURE} STREQUAL "aarch64-linux-gnu") # Jetson TX2
2931
target_link_libraries(example ${CMAKE_SOURCE_DIR}/lib/jetsontx/libCTRE_Phoenix.a)
3032
target_link_libraries(example ${CMAKE_SOURCE_DIR}/lib/jetsontx/libCTRE_PhoenixCCI.a)
33+
target_link_libraries(example ${CMAKE_SOURCE_DIR}/lib/jetsontx/libCTRE_PhoenixDiagnostics.a)
3134
target_link_libraries(example ${CMAKE_SOURCE_DIR}/lib/jetsontx/libCTRE_PhoenixPlatform_socketcan.a)
3235
target_link_libraries(example ${CMAKE_SOURCE_DIR}/lib/jetsontx/libCTRE_PhoenixCanutils.a)
36+
target_link_libraries(example ${CMAKE_SOURCE_DIR}/lib/jetsontx/libCTRE_PhoenixCore.a)
3337
else()
3438
target_link_libraries(example ${CMAKE_SOURCE_DIR}/lib/x86-64/libCTRE_Phoenix.a)
3539
target_link_libraries(example ${CMAKE_SOURCE_DIR}/lib/x86-64/libCTRE_PhoenixCCI.a)
36-
target_link_libraries(example ${CMAKE_SOURCE_DIR}/lib/x86-64/libCTRE_PhoenixPlatformLinuxSocketCan.a)
40+
target_link_libraries(example ${CMAKE_SOURCE_DIR}/lib/x86-64/libCTRE_PhoenixDiagnostics.a)
41+
target_link_libraries(example ${CMAKE_SOURCE_DIR}/lib/x86-64/libCTRE_PhoenixPlatform_socketcan.a)
3742
target_link_libraries(example ${CMAKE_SOURCE_DIR}/lib/x86-64/libCTRE_PhoenixCanutils.a)
43+
target_link_libraries(example ${CMAKE_SOURCE_DIR}/lib/x86-64/libCTRE_PhoenixCore.a)
3844
endif()
3945

4046
target_link_libraries(example Threads::Threads)

example.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ int main() {
4545
//std::cin >> interface;
4646
interface = "can0";
4747
ctre::phoenix::platform::can::SetCANInterface(interface.c_str());
48+
49+
// Comment out the call if you would rather use the automatically running diag-server, note this requires uninstalling diagnostics from Tuner.
50+
ctre::phoenix::unmanaged::SetPhoenixDiagnosticsStartTime(-1); // disable diag server, instead we will use the diag server stand alone application that Tuner installs
4851

4952
/* setup drive */
5053
initDrive();

include/ctre/Phoenix.h

+22-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#pragma once
22

3+
/* If you are linking Phoenix on a platform that is *not* the NI RoboRIO,
4+
* define Phoenix_No_WPI before the Phoenix.h include.
5+
* The Phoenix WPI extensions are only available on roboRIO.
6+
* This is necessary if compiling on RaspberryPi, Jetson, Linux-Desktop, etc.
7+
*/
38
#ifndef Phoenix_No_WPI
49
#define Phoenix_WPI
510
#endif
@@ -12,6 +17,7 @@
1217
#include "ctre/phoenix/motion/BufferedTrajectoryPointStream.h"
1318
#include "ctre/phoenix/motion/MotionProfileStatus.h"
1419
#include "ctre/phoenix/motion/TrajectoryPoint.h"
20+
#include "ctre/phoenix/motorcontrol/can/TalonFX.h"
1521
#include "ctre/phoenix/motorcontrol/can/TalonSRX.h"
1622
#include "ctre/phoenix/motorcontrol/can/VictorSPX.h"
1723
#include "ctre/phoenix/motorcontrol/DemandType.h"
@@ -21,24 +27,39 @@
2127
#include "ctre/phoenix/motorcontrol/IMotorControllerEnhanced.h"
2228
#include "ctre/phoenix/motorcontrol/InvertType.h"
2329
#include "ctre/phoenix/motorcontrol/SensorCollection.h"
30+
#include "ctre/phoenix/music/Orchestra.h"
31+
#include "ctre/phoenix/sensors/CANCoder.h"
2432
#include "ctre/phoenix/sensors/PigeonIMU.h"
2533
#include "ctre/phoenix/signals/MovingAverage.h"
26-
#include "ctre/phoenix/tasking/schedulers/ConcurrentScheduler.h"
34+
#include "ctre/phoenix/tasking/Schedulers/ConcurrentScheduler.h"
2735
#include "ctre/phoenix/tasking/ILoopable.h"
2836
#include "ctre/phoenix/tasking/IProcessable.h"
2937
#include "ctre/phoenix/Utilities.h"
3038

3139
#ifdef Phoenix_WPI
40+
#include "ctre/phoenix/motorcontrol/can/WPI_TalonFX.h"
3241
#include "ctre/phoenix/motorcontrol/can/WPI_TalonSRX.h"
3342
#include "ctre/phoenix/motorcontrol/can/WPI_VictorSPX.h"
3443
#include "ctre/phoenix/tasking/ButtonMonitor.h"
3544
#endif
3645

46+
/*
47+
* In general it is bad-practice to include namespaces in a C++ header, as this
48+
* can cause a name conflict with other types in other modules.
49+
*
50+
* However doing so allows users to quickly start developing with the Phoenix class library
51+
* with a single include "Phoenix.h", without having to learn the various namespaces.
52+
* This is particularly useful for aspiring student-programmers who may not understand all of the language features yet.
53+
*
54+
* Those who understand the benefits of namespaces can instead include the core headers (above)
55+
* or modify this header if proper namespace-scoping is required.
56+
*/
3757
using namespace ctre;
3858
using namespace ctre::phoenix;
3959
using namespace ctre::phoenix::motion;
4060
using namespace ctre::phoenix::motorcontrol;
4161
using namespace ctre::phoenix::motorcontrol::can;
62+
using namespace ctre::phoenix::music;
4263
using namespace ctre::phoenix::sensors;
4364
using namespace ctre::phoenix::signals;
4465
using namespace ctre::phoenix::tasking;

include/ctre/phoenix/CANBusAddressable.h

+7
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,17 @@ namespace ctre {
88
class CANBusAddressable {
99

1010
public:
11+
/**
12+
* Constructor for a CANBusAddressable device
13+
* @param deviceNumber CAN Device ID of device
14+
*/
1115
CANBusAddressable(int deviceNumber) {
1216
_deviceNum = deviceNumber;
1317
}
1418

19+
/**
20+
* @return CAN device number of device
21+
*/
1522
int GetDeviceNumber() {
1623
return _deviceNum;
1724
}

0 commit comments

Comments
 (0)