Skip to content
Open
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
82be619
Remove hard-coded setActuator and setLED, remove servo and stepper, m…
kvn147 Nov 26, 2025
587ceeb
Removed can_motor and sim_motor abstractions. Still need to remove ba…
kvn147 Jan 9, 2026
31785c0
CANUtils: Constructs CAN packet according to CAN2026. FakeCANBoard: R…
kvn147 Jan 24, 2026
e76c170
CANMotor updates
kvn147 Jan 24, 2026
6d309a4
real_world_constants.h: Implemented boardUUIDMap that will replace cu…
kvn147 Jan 24, 2026
425a307
update CANUtils: don't need to construct CAN or create CAN header at …
kvn147 Jan 28, 2026
a3162ff
updated FakeCANBoard to remove base_motor abstraction and semi-refact…
kvn147 Jan 30, 2026
81b3f3d
CMake w/ fetch of new CAN26 repo!
kvn147 Feb 3, 2026
16af9a5
update new device UUID mapping with CANDevices from CAN26
kvn147 Feb 3, 2026
556933d
CAN.cpp: Swapped deviceid_t for CANDeviceUUID_t, CANUtils: update get…
kvn147 Feb 4, 2026
c677964
CMake CAN26 fetch + update stubs + fix signatures
kvn147 Feb 7, 2026
9817164
moved CANBoard class to robot namespace to fix name collision
kvn147 Feb 7, 2026
f963a4e
Ignore FakeCANBoard for now
kvn147 Feb 7, 2026
99b7fab
TunePID updated for CAN26: Swap group, serial for CANDevice and remov…
kvn147 Feb 7, 2026
6531275
CAN.cpp: Telemetry updated for CAN26. CANMotor: Update with CAN26 Mot…
kvn147 Feb 7, 2026
a31e002
Removed base motor files and from CMake and removed a comment
kvn147 Feb 7, 2026
0942592
Implement setMotorVel function (originally from base_motor.cpp) for g…
kvn147 Feb 8, 2026
c12865e
Updated parts of FakeCANBoard for CAN26 + Added some print statements…
kvn147 Feb 11, 2026
96860fc
FakeCANBoard updated
kvn147 Feb 16, 2026
6fb1d76
cleanup
kvn147 Feb 16, 2026
1b74730
Removal of stepper, servo, fourbar, actuator. Adjust mapping from lef…
kvn147 Feb 21, 2026
8be3435
Merge branch 'master' into CAN-updates
kvn147 Feb 21, 2026
3f8eeb2
Update "tank style" under control interface to use front/rear left/ri…
kvn147 Feb 21, 2026
e407f05
correct mask for printCANPacket() and fix domains for front/rear Tire…
kvn147 Feb 22, 2026
1943a16
Remove handActuator/fourBar/drill from joints mapping. Telemetry set …
kvn147 Feb 22, 2026
c9d0304
Move CANBoard class to CANMotor and remove CANBoard classes from real…
kvn147 Feb 28, 2026
b308da2
CMake suppress flag to temp ignore warnings relating to parameter pas…
kvn147 Feb 28, 2026
a5ddc85
Add hearbeat timeouts with watchdog timer per device, logs when timeo…
kvn147 Feb 28, 2026
f60d878
plz work
kvn147 Mar 6, 2026
90ea90a
Rover testing
imisaacwu Apr 29, 2026
5ebe977
Removed depricated comments
kvn147 Apr 30, 2026
9dec69b
Tuning, removed deprecated
imisaacwu Apr 30, 2026
8b4f02b
Merge branch 'CAN-updates' of github.com:huskyroboticsteam/Resurgence…
imisaacwu Apr 30, 2026
b950cf2
Add acks, rover testing
imisaacwu May 8, 2026
b13c6f7
Add CANBoard
imisaacwu May 9, 2026
ddd5d61
remove power clamp
imisaacwu May 9, 2026
333f623
Fix CAN, remove TunePID
imisaacwu May 10, 2026
5c0cae7
Flesh out CANBoard, integrate into FakeCANBoard, fix sim
imisaacwu May 10, 2026
5b923b6
Integrate CANBoard into real_world_interface, update setPower for arm…
imisaacwu May 10, 2026
c8209b3
Callback shenanigans
imisaacwu May 12, 2026
c191806
Fixed callback, testing, need to double check lock behavior
imisaacwu May 13, 2026
472ae22
Add endpoint jsons, callbacks persist
imisaacwu May 14, 2026
5452d5f
Fix deadlock
imisaacwu May 15, 2026
5b085cd
Test encoder, ardupilot offset
imisaacwu May 15, 2026
f05649c
Callback fixes, encoder testing
imisaacwu May 16, 2026
c19e6ba
Isaac is delusional
imisaacwu May 18, 2026
72ea7fe
Fix problems
imisaacwu May 19, 2026
eec7b8e
Hang FakeCANBoard
imisaacwu May 19, 2026
4802e35
Broken code
imisaacwu May 19, 2026
6dff89c
Buffer
imisaacwu May 20, 2026
80e3d0a
Working buffer & encoder/telemetry reports
imisaacwu May 20, 2026
c98992b
comments for hand impl
imisaacwu May 20, 2026
b35aa81
Hand implementation (in theory)
imisaacwu May 21, 2026
4c4ad9c
Add stepper to FakeCANBoard
imisaacwu May 22, 2026
9db6cef
Merge branch 'CAN-updates' of github.com:huskyroboticsteam/Resurgence…
imisaacwu May 22, 2026
ac1416a
Add read timeouts
imisaacwu May 22, 2026
7a8d5cc
add isaac changes
imisaacwu May 24, 2026
691604a
fix attempt, adding new handler for motor disable
limellie May 24, 2026
5d78427
merge
imisaacwu May 24, 2026
6f2c37d
Fix mast cam configs
imisaacwu May 25, 2026
09819b1
Fix camera frame request
imisaacwu May 25, 2026
68c4085
Add braking
imisaacwu May 25, 2026
157faf2
Fix brake behavior
imisaacwu May 26, 2026
6823767
Set input vel to 0 on 0 power
imisaacwu May 26, 2026
4119d00
swervo/pwm
imisaacwu May 28, 2026
a8e7d29
delivery
imisaacwu May 29, 2026
9abac2c
Servo angle float fix
imisaacwu May 30, 2026
f7935c5
GPS rotation
imisaacwu May 30, 2026
49caab9
led stuff
imisaacwu May 30, 2026
b65a437
clean up CAN a little bit
imisaacwu Jun 19, 2026
f2a56c9
fixes
imisaacwu Jun 19, 2026
44a2e1c
Finish cleaning up
imisaacwu Jun 22, 2026
e55b961
Change read callback timeout to deatched thread, clean up
imisaacwu Jun 23, 2026
e23b8c4
Fix deadlock issue, remove unused
imisaacwu Jun 29, 2026
2c934d2
Make read timeout optional, fix CAN print packet, tune read timeout, …
imisaacwu Jun 29, 2026
3405f6f
Merge branch 'master' into CAN-updates
imisaacwu Jun 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
276 changes: 211 additions & 65 deletions src/CAN/CAN.cpp

Large diffs are not rendered by default.

34 changes: 22 additions & 12 deletions src/CAN/CAN.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
#include "../utils/scheduler.h"
#include "../world_interface/data.h"
#include "CANUtils.h"

#include "../Constants.h"
#include <functional>
#include <optional>

extern "C" {
#include <HindsightCAN/CANPacket.h>
#include <CANDevices.h>
#include <CANPacket.h>

#include <Packets/Motor.h>
}

/**
Expand All @@ -22,7 +25,8 @@ namespace can {
*
* Users should not construct these themselves.
*/
using callbackid_t = std::tuple<deviceid_t, telemtype_t, uint32_t>;
using callbackid_t = std::tuple<uuid_t, telemtype_t, uint32_t>;
// using callbackid_t = std::tuple<deviceid_t, telemtype_t, uint32_t>;
Comment thread
imisaacwu marked this conversation as resolved.
Outdated

/**
* @brief Initialize the CAN interface.
Expand All @@ -41,17 +45,23 @@ void initCAN();
*
* @param packet The CAN packet to send.
*/
void sendCANPacket(const CANPacket_t& packet);
void sendCANPacket(const CANPacket& packet);

// Print packet for debugging purposes
void printCANPacket(const CANPacket& packet);
void printCANPacket(const CANPacket_t& packet);

/**
* @brief Print a CAN packet.
*
*
* @param packet The CAN packet to print.
*/
void printCANPacket(const CANPacket& packet);
// new
void printCANPacket(const CANPacket_t& packet);
// void printCANPacket(const CANPacket& packet);
Comment thread
kvn147 marked this conversation as resolved.
Outdated

void initHeartbeatWatchdog();
void handleHeartbeatPacket(CANPacket_t& packet);

/**
* @brief Get the latest telemetry from a CAN device.
Expand All @@ -64,7 +74,7 @@ void printCANPacket(const CANPacket& packet);
* it was received. If no data is available for the given telemetry type, an empty data point
* is returned.
*/
robot::types::DataPoint<telemetry_t> getDeviceTelemetry(deviceid_t id, telemtype_t telemType);
robot::types::DataPoint<telemetry_t> getDeviceTelemetry(uuid_t uuid, telemtype_t telemType);

/**
* @brief Ping the given CAN device to send the given telemetry data.
Expand All @@ -75,7 +85,7 @@ robot::types::DataPoint<telemetry_t> getDeviceTelemetry(deviceid_t id, telemtype
* @param id The device group and serial number of the device.
* @param telemType The type of telemetry to get, as dictated by the specific device specs.
*/
void pullDeviceTelemetry(deviceid_t id, telemtype_t telemType);
void pullDeviceTelemetry(uuid_t uuid, telemtype_t telemType);

/**
* @brief Periodically pull the latest telemetry data from the specified CAN device
Expand All @@ -87,7 +97,7 @@ void pullDeviceTelemetry(deviceid_t id, telemtype_t telemType);
* @param telemType The type of telemetry to get, as dictated by the specific device specs.
* @param period The period to wait in between sending pull requests.
*/
void scheduleTelemetryPull(deviceid_t id, telemtype_t telemType,
void scheduleTelemetryPull(uuid_t uuid, telemtype_t telemType,
std::chrono::milliseconds period);

/**
Expand All @@ -98,7 +108,7 @@ void scheduleTelemetryPull(deviceid_t id, telemtype_t telemType,
* @param id The device group and serial number of the device.
* @param telemType The type of telemetry to get, as dictated by the specific device specs.
*/
void unscheduleTelemetryPull(deviceid_t id, telemtype_t telemType);
void unscheduleTelemetryPull(uuid_t uuid, telemtype_t telemType);

/**
* @brief Stop pulling the latest telemetry data from all currently scheduled devices.
Expand All @@ -121,8 +131,8 @@ void unscheduleAllTelemetryPulls();
* to remove a callback.
*/
callbackid_t addDeviceTelemetryCallback(
deviceid_t id, telemtype_t telemType,
const std::function<void(deviceid_t, telemtype_t, robot::types::DataPoint<telemetry_t>)>&
uuid_t uuid, telemtype_t telemType,
const std::function<void(uuid_t, telemtype_t, robot::types::DataPoint<telemetry_t>)>&
callback);

/**
Expand Down
Loading
Loading