Skip to content

Commit

Permalink
Merge branch 'main' into ClawHAL
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-mcgill authored Nov 24, 2024
2 parents c9e4d90 + 25fdffa commit ce392f3
Show file tree
Hide file tree
Showing 53 changed files with 189 additions and 2,190 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build

# Controls when the action will run
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ubuntu-latest
container: wpilib/roborio-cross-ubuntu:2024-22.04

# Tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v4

- name: Add repository to git safe directories
run: git config --global --add safe.directory $GITHUB_WORKSPACE

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build the robot code
run: ./gradlew build
38 changes: 0 additions & 38 deletions .github/workflows/main.yml

This file was deleted.

4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[![Build](https://github.com/FRC830/2024Robot/actions/workflows/main.yml/badge.svg)](https://github.com/FRC830/2024Robot/actions/workflows/main.yml)
[![Build](https://github.com/FRC830/2024WAPUR/actions/workflows/build.yml/badge.svg)](https://github.com/FRC830/2024WAPUR/actions/workflows/build.yml)

The 2024 Robot
The 2024 WAPUR Robot
47 changes: 0 additions & 47 deletions src/main/cpp/AnalogAbsoluteEncoder.cpp

This file was deleted.

46 changes: 1 addition & 45 deletions src/main/cpp/ControllerInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,7 @@

void ControllerInterface::UpdateRobotControlData(RobotControlData &controlData)
{
UpdateIntakeInput(controlData);
UpdateLauncherInput(controlData);
UpdateSwerveInput(controlData);
UpdateVisionInput(controlData);
};

void ControllerInterface::UpdateIntakeInput(RobotControlData &controlData)
{
controlData.intakeInput.goToAmpPos = m_copilot.GetLeftY() > 0.5;
controlData.intakeInput.goToStowPos = m_copilot.GetLeftY() < -0.5;
controlData.intakeInput.goToPseudoStowPos = m_copilot.GetLeftX() > 0.5;
controlData.intakeInput.runIntakeOutSlow = m_copilot.GetLeftTriggerAxis() >= 0.2;

if (controlData.intakeOutput.intakePos == IntakePos::AMP)
{
controlData.intakeInput.runIntakeIn = m_copilot.GetRightTriggerAxis() > 0.2;
controlData.launcherInput.runIndexerForward = false;
}
else
{
controlData.launcherInput.runIndexerForward = m_copilot.GetRightTriggerAxis() > 0.2;
controlData.intakeInput.runIntakeIn = false;
}

};

void ControllerInterface::UpdateLauncherInput(RobotControlData &controlData)
{
controlData.launcherInput.goToStowPos = m_copilot.GetAButton();
controlData.launcherInput.goToSubPos = m_copilot.GetYButton();
controlData.launcherInput.runIndexerBackward = m_copilot.GetLeftTriggerAxis() >= 0.2;
controlData.launcherInput.goToHoardePos = m_copilot.GetBButton();
};

void ControllerInterface::UpdateSwerveInput(RobotControlData &controlData)
Expand All @@ -50,17 +19,4 @@ void ControllerInterface::UpdateSwerveInput(RobotControlData &controlData)
controlData.swerveInput.yTranslation *= m_slowmodefactor;
controlData.swerveInput.rotation *= m_slowmodefactor;
}

if (m_pilot.GetLeftTriggerAxis() > 0.2 && m_pilot.GetRightTriggerAxis() > 0.2)
{
controlData.swerveInput.resetGyroZeroHeading = true;
}
else
{
controlData.swerveInput.resetGyroZeroHeading = false;
}
};

void ControllerInterface::UpdateVisionInput(RobotControlData &controlData) {
// FIXME
}
};
31 changes: 31 additions & 0 deletions src/main/cpp/HAL/Claw.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include "HAL/Claw.h"
#include <iostream>


Claw::Claw()
{
// TODO - configure mechanism
std::cout << "configured claw mechanism" << std::endl;
}

void Claw::Clasp()
{
if (_signal != 1)
{
std::cout << "claw is clasping" << std::endl;
_signal = 1;
}

// TODO - implement mechanism to clasp
}

void Claw::Unclasp()
{
if (_signal != 2)
{
std::cout << "claw is unclasping" << std::endl;
_signal = 2;
}

// TODO - implement mechanism to clasp
}
29 changes: 29 additions & 0 deletions src/main/cpp/HAL/Elevator.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include "HAL/Elevator.h"
#include <iostream>


Elevator::Elevator()
{
// TODO - configure motors
std::cout << "configured elevator motors" << std::endl;
}

void Elevator::ProfiledMoveToHeight(double desired_height)
{
// TODO - implement profiled move semantics
std::cout << "elevator performing profiled move to " << desired_height << std::endl;
SetHeight(desired_height);
}

double Elevator::GetHeight()
{
// TODO - read motors for height
std::cout << "elevator height measured as 0.0 inches" << std::endl;
return 0.0f;
}

void Elevator::SetHeight(double desired_height)
{
// TODO - set motors to go to height
std::cout << "elevator setting height to " << desired_height << std::endl;
}
Empty file.
Empty file.
58 changes: 0 additions & 58 deletions src/main/cpp/NavXGyro.cpp

This file was deleted.

Loading

0 comments on commit ce392f3

Please sign in to comment.