Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
7ff486b
project vimrc for FZF
itsarune Nov 23, 2023
e2258b1
filter out .swp files
itsarune Nov 25, 2023
60d7215
crosstool-ng config
itsarune Feb 9, 2025
cc78e24
Merge branch 'vimrc' of github.com:itsarune/Software into tbots_cross…
itsarune Feb 15, 2025
a184ae1
working on getting a nano compilation working
itsarune Feb 19, 2025
adf6f45
seems to compile
itsarune Feb 19, 2025
74a219a
Working impl of x-compiler
itsarune Mar 1, 2025
329019d
updat headed_estop_reader test timeout
itsarune Mar 1, 2025
f84a945
Update clang-format to work on ubuntu 24
itsarune Mar 1, 2025
aab1eed
wip
itsarune Mar 2, 2025
71ae4da
Update cross-compiler compilation paths
itsarune Mar 15, 2025
6dea991
delete my local computer config
itsarune Mar 15, 2025
9177e23
Merge branch 'master' of github.com:UBC-Thunderbots/Software into tbo…
itsarune Mar 19, 2025
6ebef9c
fix runtime issues with robot_info and robot_view widgets
itsarune Mar 19, 2025
02d6ecf
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Mar 19, 2025
e8dc746
delete crosstool-ng config
itsarune Mar 27, 2025
70dc8ce
Remove boost build flag and build c++20 for robots
itsarune Apr 4, 2025
f7e08df
Merge branch 'tbots_crosstool_compiler' of github.com:itsarune/Softwa…
itsarune Apr 4, 2025
9d0d377
Arun's refactoring of MotorService
itsarune May 3, 2025
1143567
Remove old method declarations from MotorService header
williamckha May 3, 2025
b1ce843
Merge branch 'tbots_crosstool_compiler' of https://github.com/itsarun…
williamckha May 3, 2025
558752c
Fix bugs in TmcMotorController
williamckha May 3, 2025
9ba1129
Initial implementation of StSpinMotorController
williamckha May 17, 2025
939daa8
Merge branch 'master' of https://github.com/UBC-Thunderbots/Software …
williamckha May 17, 2025
bd17506
Implement checkDriverFault in StSpinMotorController
williamckha May 17, 2025
0982f95
Fix build errors
williamckha May 17, 2025
b9a1ddb
Fix spi path bug and add additional xbox controller support
williamckha May 24, 2025
17a2fe9
Add Frame Alignment
x4132 May 31, 2025
e9ce0eb
Revert "Add Frame Alignment"
x4132 May 31, 2025
a813a36
Update StSpinMotorController frame transmission to match new spec
williamckha Jul 15, 2025
ae9d0c1
Add CRC checksum
williamckha Jul 16, 2025
a6de20e
Remove unnecessary includes
williamckha Jul 16, 2025
9169e46
Ignore conversion warnings for cppcrc
williamckha Jul 17, 2025
6b117e0
Merge remote-tracking branch 'upstream/master' into motor_firmware_in…
williamckha Aug 14, 2025
d515cee
testing spi
williamckha Aug 15, 2025
7695852
Changes from scrimmage weekend
williamckha Aug 20, 2025
1062aaa
Merge branch 'master' of https://github.com/UBC-Thunderbots/Software …
williamckha Aug 22, 2025
3159928
Merge branch 'master' of https://github.com/UBC-Thunderbots/Software …
williamckha Oct 24, 2025
17ae921
Fix build issues and update docs
williamckha Oct 24, 2025
31db8ec
Testing changes
williamckha Nov 7, 2025
eb1cdeb
Wait on data ready signal
williamckha Nov 22, 2025
5e56f18
Nits
williamckha Nov 22, 2025
3821858
Remove unused robot constant
williamckha Nov 22, 2025
6156d7f
euclidean_to_wheel.cpp changes
williamckha Nov 22, 2025
3ca4df1
Per-motor data ready GPIO
williamckha Nov 26, 2025
3a10ac7
Working motor service
williamckha Dec 18, 2025
d58d9e4
Move busy wait code to GPIO class
williamckha Jan 9, 2026
6fd9133
Update data ready GPIO pins
williamckha Jan 19, 2026
8f1d017
Updates for circular DMA based SPI with new protocol
williamckha Jan 20, 2026
01b5969
Merge branch 'master' of https://github.com/UBC-Thunderbots/Software …
williamckha Jan 20, 2026
aae2f54
Change MPS_PER_RPM constant
williamckha Jan 24, 2026
77b89d1
Implement command based SPI protocol
williamckha Feb 6, 2026
311f839
Add more SPI commands
williamckha Feb 15, 2026
44beb71
Add stspin_motor_controller_test
williamckha Feb 15, 2026
af8a626
Add enabled_motors option to stspin_motor_controller_test
williamckha Feb 21, 2026
bb4c163
Change function signatures for MotorController
williamckha Mar 16, 2026
ff88bcb
Add reflective_enum::nameOf utility function
williamckha Mar 16, 2026
7b0216f
Cancel StSpinMotorControllerTest with Ctrl+C
williamckha Mar 16, 2026
67cbc4d
Update robot constants with correct wheel angles for 2026 robot
williamckha Mar 16, 2026
6953ca4
Merge branch 'master' of https://github.com/UBC-Thunderbots/Software …
williamckha Mar 16, 2026
6bdc907
Delete robot_auto_test.cpp
williamckha Mar 16, 2026
3db198a
Add additional response types
williamckha Mar 19, 2026
1985bf9
Fix errors in drive and dribbler widget
williamckha Apr 14, 2026
08350e7
Add frame counter
williamckha Apr 14, 2026
a558c2a
Merge branch 'master' of https://github.com/UBC-Thunderbots/Software …
williamckha Apr 14, 2026
db871f0
Major refactoring
williamckha Apr 15, 2026
98d8fa8
Minor cleanup
williamckha Apr 15, 2026
e0c2eb2
Remove unnecessary earlyPoll method
williamckha Apr 15, 2026
f0d7f3f
Minor renamings
williamckha Apr 16, 2026
d74a493
Fix issue with reflective_enum::values
williamckha Apr 16, 2026
278f1c7
Add frame type for setting speed feedforward gains
williamckha Apr 18, 2026
92ceb8d
Lower max acceleration
williamckha Apr 18, 2026
e1b1575
Update robot constants for 2026
williamckha Mar 16, 2026
bf90e6a
Use robot constants directly in euclidean_to_wheel.cpp
williamckha Apr 24, 2026
5bd942c
Merge branch 'william/robot_constants' into motor_firmware_integration
williamckha Apr 24, 2026
59dc90e
Implement static feedforward gain based on driving angle
Thunderbots Apr 28, 2026
42ef088
Cleanup feedforward static gain calculation
Thunderbots Apr 29, 2026
d2072c8
Update static gain constants
Thunderbots Apr 30, 2026
03f740b
Fix thunderscope_main
Thunderbots Apr 30, 2026
e7ff0af
Add ability to drag to orient robot in GLMovementFieldTestLayer
williamckha Apr 29, 2026
9c2ba44
Fix incorrect conversion rate in tmc_motor_controller
Thunderbots May 5, 2026
0833dc7
Merge branch 'master' of https://github.com/UBC-Thunderbots/Software …
Thunderbots May 17, 2026
f9ce19d
Run formatting
Thunderbots May 17, 2026
9157ff0
refactor constants for 2026
Andrewyx May 17, 2026
1064751
merged
Andrewyx May 17, 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
11 changes: 6 additions & 5 deletions docs/useful-robot-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- [Robot Diagnostics](#robot-diagnostics)
- [For Just Diagnostics](#for-just-diagnostics)
- [For AI + Diagnostics](#for-ai--diagnostics)
- [Robot Auto Test](#robot-auto-test)
- [STSPIN Motor Controller Test](#stspin-motor-controller-test)
- [On Robot Commands](#on-robot-commands)
- [Systemd Services](#systemd-services)
- [Debugging Uart](#debugging-uart)
Expand Down Expand Up @@ -76,9 +76,10 @@ This will stop the current Systemd services, replace and restart them. Binaries
<b>This will trigger motor calibration meaning the wheels may spin. Please elevate the robot so the wheels are not touching the ground for proper calibration.</b>

```bash
bazel run //software/embedded/ansible:run_ansible --platforms=//toolchains/cc:robot -- --playbook deploy_robot_software.yml --hosts <robot_ip> --ssh_pass <robot_password>
bazel run //software/embedded/ansible:run_ansible --platforms=//toolchains/cc:robot --//software/embedded:motor_board=<motor_board> -- --playbook deploy_robot_software.yml --hosts <robot_ip> --ssh_pass <robot_password>
```

* <motor_board> is the type of motor driver board on the robot (either `STSPIN` or `TRINAMIC`)
* <robot_ip> is the IP address of the robot
* <robot_password> is the password of the `robot` user account

Expand Down Expand Up @@ -140,13 +141,13 @@ From Software/src

network_interface can be found with `ifconfig` commonly `wlp59s0` for wifi.

## Robot Auto Test
Runs the robot auto test fixture on a robot through Ansible, which tests the motor board and power board SPI and UART transfer respectively.
## STSPIN Motor Controller Test
Deploys the STSPIN Motor Controller Test binary onto a robot through Ansible.

From Software/src:

```bash
bazel run //software/embedded/ansible:run_ansible --platforms=//toolchains/cc:robot -- --playbook robot_auto_test_playbook.yml --hosts <robot_name> --ssh_pass <robot_password>
bazel run //software/embedded/ansible:run_ansible --platforms=//toolchains/cc:robot --//software/embedded:motor_board=STSPIN -- --playbook deploy_stspin_motor_controller_test.yml --hosts <robot_name> --ssh_pass <robot_password>
```

* replace the \<robot_ip\> with the actual ip address of the Raspberry Pi for the ssh connection.
Expand Down
3 changes: 3 additions & 0 deletions src/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ build --cxxopt="-DG3_DYNAMIC_LOGGING"
build --per_file_copt=.*\.pb\.(h|cc|cpp)$@-w
build --per_file_copt=./external/.*,./bazel-out/.*@-w

# Define Robot Versions
build --copt="-DCURRENT_ROBOT_VERSION=2026"

############## External Deps Compatibility ##############
build --noincompatible_disallow_ctx_resolve_tools
build --check_direct_dependencies=off
Expand Down
7 changes: 7 additions & 0 deletions src/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,13 @@ http_archive(
url = "https://github.com/analogdevicesinc/TMC-API/archive/0cd695fab6d43ceb121af4b8608e5d92b14e1ce9.tar.gz",
)

http_archive(
name = "cppcrc",
build_file = "@//extlibs:cppcrc.BUILD",
strip_prefix = "cppcrc-6360eee1c8966d32b2552ce156b135ec6a3235f1",
url = "https://github.com/DarrenLevine/cppcrc/archive/6360eee1c8966d32b2552ce156b135ec6a3235f1.zip",
)

##############################################
# Register our Toolchains
##############################################
Expand Down
9 changes: 9 additions & 0 deletions src/extlibs/cppcrc.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Description:
# A very small, fast, header-only, C++ library for generating CRCs
# https://github.com/DarrenLevine/cppcrc/tree/main

cc_library(
name = "cppcrc",
hdrs = ["cppcrc.h"],
visibility = ["//visibility:public"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ std::unique_ptr<SSLSimulationProto::RobotMoveCommand> createRobotMoveCommand(
std::unique_ptr<SSLSimulationProto::RobotCommand> getRobotCommandFromDirectControl(
unsigned int robot_id,
std::unique_ptr<TbotsProto::DirectControlPrimitive> direct_control,
RobotConstants_t& robot_constants)
robot_constants::RobotConstants& robot_constants)
{
auto move_command = createRobotMoveCommand(
*direct_control, robot_constants.front_wheel_angle_deg,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ std::unique_ptr<SSLSimulationProto::RobotMoveCommand> createRobotMoveCommand(
std::unique_ptr<SSLSimulationProto::RobotCommand> getRobotCommandFromDirectControl(
unsigned int robot_id,
std::unique_ptr<TbotsProto::DirectControlPrimitive> direct_control,
RobotConstants_t& robot_constants);
robot_constants::RobotConstants& robot_constants);

/**
* Creates a RobotCommand proto
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

#include <gtest/gtest.h>

#include "shared/2021_robot_constants.h"
#include "shared/robot_constants.h"

class SSLSimulationProtoTest : public ::testing::Test
{
protected:
RobotConstants_t robot_constants = create2021RobotConstants();
robot_constants::RobotConstants robot_constants = robot_constants::createRobotConstants();
};

TEST_F(SSLSimulationProtoTest, test_create_robot_move_command_forward_from_primitive)
Expand Down
8 changes: 4 additions & 4 deletions src/proto/message_translation/tbots_protobuf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ std::unique_ptr<TbotsProto::CostVisualization> createCostVisualization(

std::optional<TrajectoryPath> createTrajectoryPathFromParams(
const TbotsProto::TrajectoryPathParams2D& params, const Vector& initial_velocity,
const RobotConstants& robot_constants)
const robot_constants::RobotConstants& robot_constants)
{
double max_speed = convertMaxAllowedSpeedModeToMaxAllowedSpeed(
params.max_speed_mode(), robot_constants);
Expand Down Expand Up @@ -476,7 +476,7 @@ std::optional<TrajectoryPath> createTrajectoryPathFromParams(

BangBangTrajectory1DAngular createAngularTrajectoryFromParams(
const TbotsProto::TrajectoryParamsAngular1D& params,
const AngularVelocity& initial_velocity, const RobotConstants& robot_constants)
const AngularVelocity& initial_velocity, const robot_constants::RobotConstants& robot_constants)
{
return BangBangTrajectory1DAngular(
createAngle(params.start_angle()), createAngle(params.final_angle()),
Expand All @@ -489,7 +489,7 @@ BangBangTrajectory1DAngular createAngularTrajectoryFromParams(
}

int convertDribblerModeToDribblerSpeed(TbotsProto::DribblerMode dribbler_mode,
RobotConstants_t robot_constants)
robot_constants::RobotConstants robot_constants)
{
switch (dribbler_mode)
{
Expand All @@ -507,7 +507,7 @@ int convertDribblerModeToDribblerSpeed(TbotsProto::DribblerMode dribbler_mode,

double convertMaxAllowedSpeedModeToMaxAllowedSpeed(
TbotsProto::MaxAllowedSpeedMode max_allowed_speed_mode,
RobotConstants_t robot_constants)
robot_constants::RobotConstants robot_constants)
{
switch (max_allowed_speed_mode)
{
Expand Down
8 changes: 4 additions & 4 deletions src/proto/message_translation/tbots_protobuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ std::unique_ptr<TbotsProto::CostVisualization> createCostVisualization(
*/
std::optional<TrajectoryPath> createTrajectoryPathFromParams(
const TbotsProto::TrajectoryPathParams2D& params, const Vector& initial_velocity,
const RobotConstants& robot_constants);
const robot_constants::RobotConstants& robot_constants);

/**
* Generate an angular trajectory Path given angular trajectory proto parameters
Expand All @@ -257,7 +257,7 @@ std::optional<TrajectoryPath> createTrajectoryPathFromParams(
*/
BangBangTrajectory1DAngular createAngularTrajectoryFromParams(
const TbotsProto::TrajectoryParamsAngular1D& params,
const AngularVelocity& initial_velocity, const RobotConstants& robot_constants);
const AngularVelocity& initial_velocity, const robot_constants::RobotConstants& robot_constants);

/**
* Convert dribbler mode to dribbler speed
Expand All @@ -268,7 +268,7 @@ BangBangTrajectory1DAngular createAngularTrajectoryFromParams(
* @return the dribbler speed in RPM
*/
int convertDribblerModeToDribblerSpeed(TbotsProto::DribblerMode dribbler_mode,
RobotConstants_t robot_constants);
robot_constants::RobotConstants robot_constants);

/**
* Convert max allowed speed mode to max allowed speed
Expand All @@ -280,4 +280,4 @@ int convertDribblerModeToDribblerSpeed(TbotsProto::DribblerMode dribbler_mode,
*/
double convertMaxAllowedSpeedModeToMaxAllowedSpeed(
TbotsProto::MaxAllowedSpeedMode max_allowed_speed_mode,
RobotConstants_t robot_constants);
robot_constants::RobotConstants robot_constants);
3 changes: 1 addition & 2 deletions src/proto/message_translation/tbots_protobuf_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ TEST_P(TrajectoryParamConversionTest, trajectory_params_msg_test)
// Generate a trajectory, and then generate a TbotsProto::TrajectoryPathParams2D
// with the same parameters as the trajectory, finally, generate a second trajectory
// from the parameters and make sure the two trajectories are equal.
RobotConstants robot_constants = create2021RobotConstants();
Point start_position(0.0, 0.0);
robot_constants::RobotConstants robot_constants = robot_constants::createRobotConstants(); Point start_position(0.0, 0.0);
Point destination(0.0, 0.0);

std::vector<Point> sub_destinations = std::get<0>(GetParam());
Expand Down
5 changes: 2 additions & 3 deletions src/proto/primitive/primitive_msg_factory_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

#include <gtest/gtest.h>

#include "shared/2021_robot_constants.h"
#include "shared/constants.h"
#include "shared/robot_constants.h"
#include "software/test_util/test_util.h"

class PrimitiveFactoryTest : public testing::Test
{
protected:
RobotConstants_t robot_constants = create2021RobotConstants();
};
robot_constants::RobotConstants robot_constants = robot_constants::createRobotConstants();};

TEST_F(PrimitiveFactoryTest, test_auto_chip_or_kick_equality)
{
Expand Down
15 changes: 15 additions & 0 deletions src/proto/robot_status_msg.proto
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ enum ErrorCode

enum MotorFault
{
/*********** TMC Faults ************/
// Refer to Trinamic 6100 datasheet for precise definitions of motor faults.
// https://trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC6100_datasheet_Rev1.00.pdf
// (Section 5.1, p22-23)
Expand All @@ -99,6 +100,20 @@ enum MotorFault
PHASE_W_SHORT_COUNTER_DETECTED = 12;
PHASE_W_SHORT_TO_GND_DETECTED = 13;
PHASE_W_SHORT_TO_VS_DETECTED = 14;

/*********** STSPIN Faults ************/
NO_FAULT = 15;
DURATION = 16;
OVER_VOLT = 17;
UNDER_VOLT = 18;
OVER_TEMP = 19;
START_UP = 20;
SPEED_FDBK = 21;
OVER_CURR = 22;
SW_ERROR = 23;
SAMPLE_FAULT = 24;
OVERCURR_SW = 25;
DP_FAULT = 26;
Comment thread
itsarune marked this conversation as resolved.
}

message DriveUnit
Expand Down
38 changes: 0 additions & 38 deletions src/shared/2021_robot_constants.cpp

This file was deleted.

10 changes: 0 additions & 10 deletions src/shared/2021_robot_constants.h

This file was deleted.

9 changes: 2 additions & 7 deletions src/shared/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ cc_library(

cc_library(
name = "robot_constants",
srcs = [
"2021_robot_constants.cpp",
],
hdrs = [
"2021_robot_constants.h",
"robot_constants.h",
],
srcs = [],
hdrs = [":robot_constants.h"],
deps = [":constants"],
)
8 changes: 4 additions & 4 deletions src/shared/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <string>
#include <unordered_map>

#define CHECK_VERSION(v) (CURRENT_ROBOT_VERSION == v)

// Networking
// the IPv6 multicast address, only ff02 is important, the rest is random
// see https://en.wikipedia.org/wiki/Solicited-node_multicast_address for why ff02 matters
Expand All @@ -21,9 +23,7 @@ static const std::unordered_map<int, std::string> ROBOT_MULTICAST_CHANNELS = {
{14, "ff02::c3d0:42d2:bb14"}, {15, "ff02::c3d0:42d2:bb15"}};

// PlotJuggler's default host and port
// Should be updated to your local machine's IP address if
// you want to plot from the robot
static const std::string PLOTJUGGLER_GUI_DEFAULT_HOST = "127.0.0.1";
static const std::string PLOTJUGGLER_GUI_DEFAULT_HOST = "ff02::c3d0:42d2:aaaa";
static const short unsigned int PLOTJUGGLER_GUI_DEFAULT_PORT = 9870;

// ProtoLogger constants for replay files
Expand Down Expand Up @@ -70,7 +70,7 @@ static const double BALL_IN_PLAY_DISTANCE_THRESHOLD_METERS = 0.05;
// The max allowed height of the robots, in metres
static const double ROBOT_MAX_HEIGHT_METERS = 0.15;
// The max allowed radius of the robots, in metres
static const double ROBOT_MAX_RADIUS_METERS = 0.09;
constexpr double ROBOT_MAX_RADIUS_METERS = 0.09;
// The distance from the center of the robot to the front face (the flat part), in meters
static const double DIST_TO_FRONT_OF_ROBOT_METERS = 0.078;
// The approximate radius of the ball according to the SSL rulebook
Expand Down
Empty file.
Loading
Loading