Skip to content

Commit

Permalink
External AD* implementation for PPLib (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
having11 authored Jun 21, 2024
1 parent 3d1039f commit 61d29e5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ logs

# Executables
*.exe
!pplib_coprocessor.exe
*.out
*.app

Expand Down
Binary file added pplib_coprocessor.exe
Binary file not shown.
3 changes: 3 additions & 0 deletions run_pplib.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
echo Usage: run_pplib.bat ^<RIO_IP^>
pplib_coprocessor.exe --server %1
7 changes: 7 additions & 0 deletions src/main/cpp/RobotContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include <frc2/command/WaitCommand.h>
#include <frc2/command/button/JoystickButton.h>
#include <pathplanner/lib/auto/AutoBuilder.h>
#include <pathplanner/lib/pathfinding/Pathfinding.h>
#include <pathplanner/lib/pathfinding/RemoteADStar.h>
#include <pathplanner/lib/util/PathPlannerLogging.h>
#include <subzero/logging/ShuffleboardLogger.h>
#include <subzero/utils/InputUtils.h>
Expand Down Expand Up @@ -80,6 +82,11 @@ RobotContainer::RobotContainer() {
}

void RobotContainer::RegisterAutos() {
#ifdef USE_REMOTE_AD_STAR
pathplanner::Pathfinding::setPathfinder(
std::make_unique<pathplanner::RemoteADStar>());
#endif

pathplanner::NamedCommands::registerCommand(AutoConstants::kLedFunniName,
m_leds.Intaking());
pathplanner::NamedCommands::registerCommand(
Expand Down
4 changes: 4 additions & 0 deletions src/main/include/constants/AutoConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

#include "constants/ScoringConstants.h"

// See https://github.com/mjansen4857/pplib_coprocessor
// Ensure run_pplib.bat is running from the root of this repo too if in-use
#define USE_REMOTE_AD_STAR

namespace AutoConstants {
constexpr auto kMaxSpeed = 3_mps;
constexpr auto kMaxAcceleration = 1.5_mps_sq;
Expand Down

0 comments on commit 61d29e5

Please sign in to comment.