Skip to content

Commit 6fe6618

Browse files
committed
jetson_script cleanup, removed old includes
1 parent 5a35691 commit 6fe6618

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

jetson_script/Arm.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
ODrive or Solo. As of 2/8/26, no specific decision has been made yet*/
1919

2020
#include "Arm.h"
21-
#include "MotorControl.h"
21+
#include "Dynamixel.h"
2222

2323
const long SERIAL_BAUD_RATE = 38400;
2424
const uint8_t RUN_CURRENT_PERCENT = 100;
@@ -27,10 +27,6 @@ const uint8_t HOLD_CURRENT_STANDSTILL = 0;
2727
const int32_t RUN_VELOCITY = 40000;
2828
const int32_t STOP_VELOCITY = 0;
2929

30-
const long SERIAL_BAUD_RATE = 38400;
31-
const uint8_t RUN_CURRENT_PERCENT = 100;
32-
const uint8_t HOLD_CURRENT_STANDSTILL = 0;
33-
3430
// variables
3531
qindesign::network::EthernetUDP udp;
3632
TMC2209 stepper_driver;

jetson_script/Arm.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef ARM_H
2+
#define ARM_H
3+
14
/**************************GENERAL LIBRARIES**************************/
25
/*******************TO BE UTILIZED FOR ALL MOTORS*******************/
36

@@ -18,4 +21,6 @@ int kbhit(void); // Dynamixel SDK function
1821
void test_stepper();
1922
void test_stepper_2();
2023
void run_stepper();
21-
void run_stepper_2();
24+
void run_stepper_2();
25+
26+
#endif

jetson_script/Motors.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "MotorControl.h"
1+
#include "Dynamixel.h"
22

33
// Data about each motor to be sent to SOLO
44
enum class CAN_Send_State {
@@ -27,8 +27,8 @@ int clampDriveRequest(int speedReference) {
2727

2828
// Reads Ethernet message and sets motor points in array
2929
void handleDriveRequest(DrivetrainRequest newMessage) {
30-
motorSetpoints[MOTOR_IDS[0]] = clampDriveRequest(message.m1Setpoint);
31-
motorSetpoints[MOTOR_IDS[1]] = clampDriveRequest(message.m2Setpoint);
32-
motorSetpoints[MOTOR_IDS[2]] = clampDriveRequest(message.m3Setpoint);
33-
motorSetpoints[MOTOR_IDS[3]] = clampDriveRequest(message.m4Setpoint);
30+
motorSetpoints[MOTOR_IDS[0]] = clampDriveRequest(newMessage.m1Setpoint);
31+
motorSetpoints[MOTOR_IDS[1]] = clampDriveRequest(newMessage.m2Setpoint);
32+
motorSetpoints[MOTOR_IDS[2]] = clampDriveRequest(newMessage.m3Setpoint);
33+
motorSetpoints[MOTOR_IDS[3]] = clampDriveRequest(newMessage.m4Setpoint);
3434
}

jetson_script/Motors.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ all the general motor functions that will be used across different
44
subsystems (arm, science, drivetrain)
55
*/
66

7-
#ifdef MOTORS_H
7+
#ifndef MOTORS_H
88
#define MOTORS_H
99

1010
class Motor {
@@ -16,6 +16,9 @@ class Motor {
1616
Motor(const Motor&) = delete;
1717
Motor& operator = (const Motor&) = delete;
1818

19+
protected:
20+
Motor() = default;
21+
1922
// General motor methods that each motor in every subsystem may need
2023
// UPDATE AS WE GO ALONG
2124
virtual void setSpeed() = 0;

0 commit comments

Comments
 (0)