Skip to content
Merged
Show file tree
Hide file tree
Changes from 75 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
532ff8e
Transmitter implementation
ericv555 Feb 9, 2025
ab1b32c
Made transmitter into pointer
ericv555 Feb 9, 2025
1b12b3a
Delete src/sensors/Transmitter.hpp~
ericv555 Feb 9, 2025
6e04471
Delete src/sensors/Transmitter.cpp~
ericv555 Feb 9, 2025
7fe0b5a
small cleanup in main
ericv555 Feb 9, 2025
af7bb54
delete edit files
ericv555 Feb 9, 2025
3e34df8
merge from main
ericv555 Feb 9, 2025
b88549c
transmitter timeout & dr16 keyboard variable init to zero
ericv555 Feb 12, 2025
6ce298c
misspell
ericv555 Feb 12, 2025
c44ef58
fixed misspell x2
ericv555 Feb 12, 2025
5f62a81
test purposes
ericv555 Feb 12, 2025
0ef9f9a
deleted all print statements
ericv555 Feb 12, 2025
cc27de1
found and destroyed secret print statements
ericv555 Feb 12, 2025
055c2ea
found and destroyed secret print statements
ericv555 Feb 12, 2025
002a152
found and destroyed secret print statements
ericv555 Feb 12, 2025
bd6bb9a
found and destroyed secret print statements
ericv555 Feb 12, 2025
a692b8f
found and destroyed secret print statements
ericv555 Feb 12, 2025
a89cd05
must find bug
ericv555 Feb 12, 2025
4124f21
error
ericv555 Feb 12, 2025
7b244f2
more tests
ericv555 Feb 12, 2025
0a014df
zero initalize keys for dr16
ericv555 Feb 19, 2025
558c26b
replace transmitter with ET16S for testing
ericv555 Feb 19, 2025
49e60b9
added extra print statement to who_am_i
ericv555 Feb 19, 2025
00a9e86
added extra print statement to who_am_i
ericv555 Feb 19, 2025
eed0742
added extra print statement to who_am_i
ericv555 Feb 19, 2025
f15709f
millis in wrong place
ericv555 Feb 19, 2025
ce9595a
added print statements for test
ericv555 Feb 19, 2025
e588fe6
more prints
ericv555 Feb 19, 2025
abbbfcf
inverted down and middle for three switch
ericv555 Feb 19, 2025
fbf82c5
inverted down and middle for three switch
ericv555 Feb 19, 2025
28bbd5a
reintroduced state prints
ericv555 Feb 19, 2025
efaae46
merged
ericv555 Feb 21, 2025
19ace1b
left a --head in the merge
ericv555 Feb 21, 2025
e09774d
re-enabled transmitter type
ericv555 Feb 21, 2025
62c8238
merge
ericv555 Feb 22, 2025
0b32fdd
changed all wfly calls to transmitter calls
ericv555 Feb 22, 2025
a36f2c3
flipped x and y
ericv555 Feb 23, 2025
9de16a9
flipped x and y on l stick
ericv555 Feb 23, 2025
efd52ff
flipped x and y on l stick
ericv555 Feb 23, 2025
388b0ea
swapped x and y on l stick
ericv555 Feb 23, 2025
ce6ecb5
improved set_config
ericv555 Feb 23, 2025
e66a7b8
testing wheel configuration
ericv555 Feb 23, 2025
51f2b22
reverted wheel test
ericv555 Feb 23, 2025
d678e18
changed order of switch pos enum
ericv555 Feb 23, 2025
b62d583
moved switch pos to transmitter
ericv555 Feb 23, 2025
a859cd0
Changed all switch usage to SwitchPos
ericv555 Feb 23, 2025
74eb7bd
fully commented
ericv555 Feb 23, 2025
d7c9e2a
added data struct for comms
ericv555 Feb 23, 2025
d5926f3
added raw input getter to ET16S
ericv555 Feb 23, 2025
dc6c9af
recommented memcpy in main
ericv555 Feb 23, 2025
ddc3477
fixed switched position
ericv555 Feb 23, 2025
06fd2e5
uncommeneted memcpy
ericv555 Feb 23, 2025
6bd4b2a
Updated read logic, changed low constant
Pandabear1125 Feb 28, 2025
447fb16
Updated some docs, changed who_am_i's logic
Pandabear1125 Mar 6, 2025
b5b0a50
adds keys
Pandabear1125 Mar 9, 2025
50f18a1
Fixes bad index. Brings back prints
cu-boulder-robotics Mar 15, 2025
b1b6aa4
Made the transmitter have more optional returns. Actually check the o…
cu-boulder-robotics Mar 15, 2025
278fadc
Averages the output of the ET16S to prevent YAW noise
cu-boulder-robotics Mar 15, 2025
0b7845d
docs
Pandabear1125 Mar 15, 2025
477327a
Stuff
Pandabear1125 Mar 15, 2025
33f5e5e
merge from main
Pandabear1125 Mar 15, 2025
ddb1b2b
Removes commented prints
Pandabear1125 Mar 15, 2025
82f3016
Me when tabs
Pandabear1125 Mar 15, 2025
13a0080
enabled channel 16 and set it to left dial
ericv555 Mar 19, 2025
9596263
merged with comms-refactor
ericv555 Apr 9, 2025
c585edc
changed DR16Data to TransmitterData
ericv555 Apr 13, 2025
08acfe6
comms merge
ericv555 Apr 19, 2025
f3798ac
int -> flota
ericv555 Apr 20, 2025
e15d2d9
Merge from main
Pandabear1125 Apr 27, 2025
9c167fb
merge
ericv555 Apr 30, 2025
d976e9f
changed dr16 to transmitter
ericv555 Apr 30, 2025
ec4a893
merge
ericv555 Apr 30, 2025
eac6460
init skill issue
cu-boulder-robotics May 1, 2025
9b58eb8
Completed pull request comments
ericv555 Aug 30, 2025
8d9e8f2
merged
ericv555 Aug 30, 2025
bed34cb
merged main
roccoagain Sep 9, 2025
e0fa5b2
use ET16S_PACKET_SIZE from ET16S.hpp instead
roccoagain Sep 16, 2025
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
2 changes: 1 addition & 1 deletion src/comms/config_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,4 @@ class ConfigLayer {

extern Config config;

#endif
#endif
6 changes: 3 additions & 3 deletions src/comms/data/comms_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ enum class TypeLabel : uint8_t {
RevEncoderData,
TOFSensorData,
LidarDataPacketSI,
DR16Data,
TransmitterData,
TempRobotState,
TargetState,
EstimatedState,
Expand Down Expand Up @@ -48,8 +48,8 @@ inline std::string to_string(TypeLabel type_label) {
return "TOFSensorData";
case TypeLabel::LidarDataPacketSI:
return "LidarDataPacketSI";
case TypeLabel::DR16Data:
return "DR16Data";
case TypeLabel::TransmitterData:
return "TransmitterData";
case TypeLabel::TempRobotState:
return "TempRobotState";
case TypeLabel::TargetState:
Expand Down
6 changes: 3 additions & 3 deletions src/comms/data/data_structs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "modules/comms/data/comms_data.hpp" // for CommsData
#endif

#include <stdint.h> // uintN_t
#include <stdint.h> // uintN_t

#include "test_data.hpp"

Expand All @@ -21,12 +21,12 @@

#include "lidar_data_packet_si.hpp"

#include "dr16_data.hpp"
#include "transmitter_data.hpp"

#include "robot_state_data.hpp"

#include "config_section.hpp"

#include "comms_ref_data.hpp"

#endif // DATA_STRUCTS_HPP
#endif // DATA_STRUCTS_HPP
71 changes: 0 additions & 71 deletions src/comms/data/dr16_data.hpp

This file was deleted.

16 changes: 8 additions & 8 deletions src/comms/data/firmware_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ void FirmwareData::set_data(CommsData* data) {

break;
}
case TypeLabel::DR16Data: {
case TypeLabel::TransmitterData: {
// place the data in the mega struct
dr16_data = *static_cast<DR16Data*>(data);
transmitter_data = *static_cast<TransmitterData*>(data);
break;
}
case TypeLabel::BuffEncoderData: {
Expand Down Expand Up @@ -125,7 +125,7 @@ void FirmwareData::set_data(CommsData* data) {
}

} // namespace Comms

#if defined(HIVE)

TEST_CASE("setting firmware data structs") {
Expand Down Expand Up @@ -196,10 +196,10 @@ TEST_CASE("setting firmware data structs") {
firmware_data.set_data(&lidar_sensor_data);
CHECK(firmware_data.lidars[1].back().lidar_speed == 55);

DR16Data dr16_data;
dr16_data.mouse_x = 55;
firmware_data.set_data(&dr16_data);
CHECK(firmware_data.dr16_data.mouse_x == 55);
TransmitterData transmitter_data;
transmitter_data.mouse_x = 55;
firmware_data.set_data(&transmitter_data);
CHECK(firmware_data.transmitter_data.mouse_x == 55);

ConfigSection config_section;
config_section.section_id = 55;
Expand All @@ -212,4 +212,4 @@ TEST_CASE("setting firmware data structs") {
CHECK(firmware_data.ref_data.game_status.raw[0] == 55);
}

#endif // defined(HIVE)
#endif // defined(HIVE)
4 changes: 2 additions & 2 deletions src/comms/data/firmware_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ struct FirmwareData {
/// @brief lidar vector
std::vector<LidarDataPacketSI> lidars[2];

/// @brief DR16 data
DR16Data dr16_data;
/// @brief Transmitter data
TransmitterData transmitter_data;

/// @brief Config section
ConfigSection config_section;
Expand Down
107 changes: 107 additions & 0 deletions src/comms/data/transmitter_data.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#pragma once

#if defined(FIRMWARE)
#include "comms/data/comms_data.hpp" // for CommsData
#elif defined(HIVE)
#include "modules/comms/data/comms_data.hpp" // for CommsData
#endif

#include <stdint.h> // uintN_t
#include <optional> // std::optional

/// @brief Switch Position Enum
enum class SwitchPos{
INVALID = 0,
FORWARD,
BACKWARD,
MIDDLE
};

/// @brief Structure for the Transmitter
struct TransmitterData : Comms::CommsData {
TransmitterData() : CommsData(Comms::TypeLabel::TransmitterData, Comms::PhysicalMedium::Ethernet, Comms::Priority::High, sizeof(TransmitterData)) { }

/// mouse x velocity
std::optional<float> mouse_x = {};
/// mouse y velocity
std::optional<float> mouse_y = {};
/// mouse z velocity
std::optional<float> mouse_z = {};
/// left mouse button status
std::optional<bool> l_mouse_button = {};
/// right mouse button status
std::optional<bool> r_mouse_button = {};
/// left switch status
SwitchPos l_switch = SwitchPos::INVALID;
/// right switch status
SwitchPos r_switch = SwitchPos::INVALID;
/// left stick x axis
float l_stick_x = 0;
/// left stick y axis
float l_stick_y = 0;
/// right stick x axis
float r_stick_x = 0;
/// right stick y axis
float r_stick_y = 0;
/// wheel
std::optional<float> wheel = {};
/// safety switch
std::optional<SwitchPos> safety_switch = {};
/// switch b
std::optional<SwitchPos> switch_b = {};
/// switch c
std::optional<SwitchPos> switch_c = {};
/// switch d
std::optional<SwitchPos> switch_d = {};
/// switch e
std::optional<SwitchPos> switch_e = {};
/// switch f
std::optional<SwitchPos> switch_f = {};
/// switch g
std::optional<SwitchPos> switch_g = {};
/// switch h
std::optional<SwitchPos> switch_h = {};
/// left dial
std::optional<float> l_dial = {};
/// right dial
std::optional<float> r_dial = {};
/// left slider
std::optional<float> l_slider = {};
/// right slider
std::optional<float> r_slider = {};
/// trim one
std::optional<float> trim_one = {};
/// trim two
std::optional<float> trim_two = {};
/// trim three
std::optional<float> trim_three = {};
/// trim four
std::optional<float> trim_four = {};
/// trim five
std::optional<float> trim_five = {};
/// trim six
std::optional<float> trim_six = {};

/// @brief Keys
union {
uint16_t raw = 0;
struct {
bool w : 1;
bool s : 1;
bool a : 1;
bool d : 1;
bool shift : 1;
bool ctrl : 1;
bool q : 1;
bool e : 1;
bool r : 1;
bool f : 1;
bool g : 1;
bool z : 1;
bool x : 1;
bool c : 1;
bool v : 1;
bool b : 1;
} key;
} keys;
};
1 change: 1 addition & 0 deletions src/controls/controller_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ void ControllerManager::step(float macro_reference[STATE_LEN][3], float macro_es
for (size_t j = 0; j < CAN_MAX_MOTORS + 1; j++) {
if (config_data->controller_info[i][j + 1] < 0) break;
actuator_write(config_data->controller_info[i][j + 1], outputs[j]);

}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/controls/estimator_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ EstimatorManager::~EstimatorManager() {
}

void EstimatorManager::init(CANManager* _can, const Config* _config_data, SensorManager* _sensor_manager) {

// set can and config data pointers
can = _can;
config_data = _config_data;
Expand Down Expand Up @@ -106,4 +105,4 @@ void EstimatorManager::clear_outputs(float macro_outputs[STATE_LEN][3], float mi
micro_outputs[i][j] = 0;
}
}
}
}
Loading