Skip to content

Commit

Permalink
Merge branch 'develop' into amputate
Browse files Browse the repository at this point in the history
  • Loading branch information
calebchalmers authored Nov 19, 2024
2 parents 8c91ce9 + bc4c7fe commit 9322a50
Show file tree
Hide file tree
Showing 71 changed files with 1,669 additions and 743 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
fetch-depth: 0

- name: Lint
uses: super-linter/super-linter/slim@v6.3.0
uses: super-linter/super-linter/slim@v7
env:
VALIDATE_CLANG_FORMAT: true
VALIDATE_ALL_CODEBASE: false
Expand Down
2 changes: 1 addition & 1 deletion taproot
Submodule taproot updated from 6d87b0 to 22b708
16 changes: 16 additions & 0 deletions ut-robomaster/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,22 @@
<option name="taproot:board:analog_in_pins"></option>
<option name="taproot:board:pwm_pins">C1,C2,C3,C4,C5,C6,C7,Buzzer,ImuHeater</option>

<option name="taproot:modm-project.xml:modm_hal_modules">
modm:platform:i2c:2
modm:platform:rtt
</option>

<option name="taproot:modm-project.xml:modm_hal_options">
modm:platform:rtt:buffer.rx 0,00,000,0000
modm:platform:rtt:buffer.tx 1024,0b10000000000,0o2000,0x400
modm:platform:uart:1:buffer.rx 256
modm:platform:uart:1:buffer.tx 256
modm:platform:uart:3:buffer.tx 256
modm:platform:uart:3:buffer.rx 256
modm:platform:uart:6:buffer.rx 256
modm:platform:uart:6:buffer.tx 256
</option>

</options>
<modules>
<module>taproot:core</module>
Expand Down
8 changes: 7 additions & 1 deletion ut-robomaster/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ static void updateIo(src::Drivers *drivers)
drivers->remote.read();
}

static void updateImu(src::Drivers *drivers)
{
drivers->bmi088.read();
drivers->bmi088.periodicIMUUpdate();
}

src::Drivers drivers;
RobotControl control{&drivers};

Expand All @@ -61,7 +67,7 @@ int main()

if (refreshTimer.execute())
{
PROFILE(drivers.profiler, drivers.bmi088.periodicIMUUpdate, ());
PROFILE(drivers.profiler, updateImu, (&drivers));
PROFILE(drivers.profiler, drivers.commandScheduler.run, ());
PROFILE(drivers.profiler, drivers.djiMotorTxHandler.encodeAndSendCanData, ());
PROFILE(drivers.profiler, drivers.terminalSerial.update, ());
Expand Down
4 changes: 0 additions & 4 deletions ut-robomaster/src/robots/common/common_control_manual.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@

#include "robots/common/common_control.hpp"
#include "subsystems/chassis/command_move_chassis.hpp"
#include "subsystems/chassis/command_move_chassis_joystick.hpp"
#include "subsystems/chassis/command_move_chassis_keyboard.hpp"
#include "subsystems/flywheel/command_flywheel_off.hpp"
#include "subsystems/flywheel/command_rotate_flywheel.hpp"
#include "subsystems/turret/command_move_turret.hpp"
#include "subsystems/turret/command_move_turret_aimbot.hpp"
#include "subsystems/turret/command_move_turret_joystick.hpp"
#include "subsystems/turret/command_move_turret_mouse.hpp"

class CommonControlManual : protected CommonControl
{
Expand Down
4 changes: 0 additions & 4 deletions ut-robomaster/src/subsystems/agitator/agitator_subsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@

namespace subsystems::agitator
{

using tap::algorithms::compareFloatClose;
using tap::arch::clock::getTimeMilliseconds;

/**
* AgitatorSubsystem class instantiation
*/
#if defined(TARGET_STANDARD) || defined(TARGET_SENTRY)
AgitatorSubsystem::AgitatorSubsystem(
src::Drivers* drivers,
Expand Down
12 changes: 2 additions & 10 deletions ut-robomaster/src/subsystems/agitator/agitator_subsystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

#include "drivers.hpp"

namespace subsystems
{
namespace agitator
namespace subsystems::agitator
{
using flywheel::FlywheelSubsystem;
using motors::MotorController;
Expand All @@ -21,11 +19,7 @@ class AgitatorSubsystem : public Subsystem
{
public:
AgitatorSubsystem(src::Drivers *drivers, FlywheelSubsystem *flywheel, MotorConfig motor);

~AgitatorSubsystem() = default;

void initialize() override;

void refresh() override;

float getShapedVelocity(float time, float a, float phi, float ballsPerSecond);
Expand All @@ -47,6 +41,4 @@ class AgitatorSubsystem : public Subsystem
MotorController feeder;
#endif
};

} // namespace agitator
} // namespace subsystems
} // namespace subsystems::agitator
14 changes: 3 additions & 11 deletions ut-robomaster/src/subsystems/chassis/chassis_subsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
#include "robots/robot_constants.hpp"
#include "subsystems/subsystem.hpp"

namespace subsystems::chassis
{
using namespace tap::algorithms;

namespace subsystems
{
namespace chassis
{
ChassisSubsystem::ChassisSubsystem(src::Drivers* drivers)
: Subsystem(drivers),
drivers(drivers),
Expand Down Expand Up @@ -68,11 +66,6 @@ void ChassisSubsystem::limitChassisPower()
}
}

void ChassisSubsystem::runHardwareTests()
{
// TODO
}

bool ChassisSubsystem::hardwareOk()
{
for (int8_t i = 0; i < WHEELS; i++)
Expand Down Expand Up @@ -139,5 +132,4 @@ Vector3f ChassisSubsystem::measureVelocity()
// Rotated -90 deg to match our reference frame
return Vector3f(ya, -xa, wa) * WHEEL_RADIUS / 4.0f * M_TWOPI;
}
} // namespace chassis
} // namespace subsystems
} // namespace subsystems::chassis
23 changes: 5 additions & 18 deletions ut-robomaster/src/subsystems/chassis/chassis_subsystem.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef CHASSIS_SUBSYSTEM_HPP_
#define CHASSIS_SUBSYSTEM_HPP_
#pragma once

#include "tap/control/subsystem.hpp"

Expand All @@ -11,29 +10,22 @@

#include "drivers.hpp"

namespace subsystems::chassis
{
using namespace tap::communication::sensors::imu;
using namespace modm;
using motors::MotorController;

namespace subsystems
{
namespace chassis
{
class ChassisSubsystem : public Subsystem
{
public:
ChassisSubsystem(src::Drivers* drivers);

void initialize() override;

void refresh() override;
bool hardwareOk() override;

void limitChassisPower();

void runHardwareTests() override;

bool hardwareOk() override;

/// @brief Update robot motion based on simple input controls. Inputs are scaled and corrected
/// to avoid over-driving motors. This logic can be adjusted to create various input schemes.
/// @param move Linear movement (magnitude should be within [0,1])
Expand All @@ -44,8 +36,6 @@ class ChassisSubsystem : public Subsystem
/// @return x,y is linear velocity (m/s) and z is angular velocity (rad/s)
Vector3f measureVelocity();

const char* getName() override { return "Chassis subsystem"; }

private:
src::Drivers* drivers;
power_limiter::PowerLimiter powerLimiter;
Expand All @@ -67,7 +57,4 @@ class ChassisSubsystem : public Subsystem
static constexpr float ENERGY_BUFFER_CRIT_THRESHOLD = 30.0f;
#endif
};
} // namespace chassis
} // namespace subsystems

#endif
} // namespace subsystems::chassis

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 9322a50

Please sign in to comment.