-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
65 changed files
with
1,916 additions
and
327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
name: Run pre-commit | ||
|
||
# yamllint disable-line rule:truthy | ||
on: [push, workflow_dispatch] | ||
|
||
# Cancels this run if a new one referring to the same object and same workflow | ||
# is requested | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
# The version of caching we are using. This can be upgraded if we | ||
# significantly change CI to the point where old caches become irrelevant. | ||
CACHE_VERSION: 0 | ||
# Default Python version. Noetic defaults to 3.8. | ||
DEFAULT_PYTHON: 3.8 | ||
# Location of the pre-commit cache. This is set by pre-commit, not us! | ||
PRE_COMMIT_CACHE: ~/.cache/pre-commit | ||
|
||
jobs: | ||
pre-commit: | ||
name: Run pre-commit | ||
runs-on: | ||
group: mala-lab-pre-commit | ||
steps: | ||
- name: Check out code from GitHub | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Set up Python ${{ env.DEFAULT_PYTHON }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
cache: "pip" | ||
- name: Install pre-commit hooks | ||
run: | | ||
python --version | ||
pip install "$(cat requirements.txt | grep pre-commit)" | ||
- name: Generate pre-commit cache key | ||
id: pre-commit_cache_key | ||
run: > | ||
echo "::set-output | ||
name=key::${{ env.CACHE_VERSION }}-${{ env.DEFAULT_PYTHON }}-${{ | ||
hashFiles('.pre-commit-config.yaml') }}" | ||
- name: Restore base pre-commit environment | ||
id: cache-pre-commmit | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ env.PRE_COMMIT_CACHE }} | ||
key: > | ||
${{ runner.os | ||
}}-pre-commit-${{ steps.pre-commit_cache_key.outputs.key }} | ||
- name: Install pre-commit dependencies if no cache | ||
if: steps.cache-precommit.outputs.cache-hit != 'true' | ||
run: | | ||
pre-commit install-hooks | ||
- name: Run pre-commit | ||
run: | | ||
pre-commit run --all-files --show-diff-on-failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
NaviGator/hardware_drivers/navigator_drone_comm/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
cmake_minimum_required(VERSION 3.0.2) | ||
project(navigator_drone_comm) | ||
|
||
find_package(catkin REQUIRED COMPONENTS | ||
rospy | ||
) | ||
|
||
catkin_python_setup() | ||
catkin_package() | ||
|
||
include_directories( | ||
# include | ||
${catkin_INCLUDE_DIRS} | ||
) |
10 changes: 10 additions & 0 deletions
10
NaviGator/hardware_drivers/navigator_drone_comm/navigator_drone_comm/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from .packets import ( | ||
Color, | ||
EStopPacket, | ||
GPSDronePacket, | ||
HeartbeatReceivePacket, | ||
HeartbeatSetPacket, | ||
StartPacket, | ||
StopPacket, | ||
TargetPacket, | ||
) |
91 changes: 91 additions & 0 deletions
91
NaviGator/hardware_drivers/navigator_drone_comm/navigator_drone_comm/packets.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
from dataclasses import dataclass | ||
from enum import Enum | ||
|
||
from electrical_protocol import Packet | ||
|
||
|
||
@dataclass | ||
class HeartbeatReceivePacket( | ||
Packet, | ||
class_id=0x20, | ||
subclass_id=0x00, | ||
payload_format="", | ||
): | ||
""" | ||
Heartbeat packet sent from the drone. | ||
""" | ||
|
||
|
||
@dataclass | ||
class HeartbeatSetPacket(Packet, class_id=0x20, subclass_id=0x01, payload_format=""): | ||
""" | ||
Heartbeat packet sent from the boat. | ||
""" | ||
|
||
|
||
@dataclass | ||
class GPSDronePacket(Packet, class_id=0x20, subclass_id=0x02, payload_format="<fff"): | ||
""" | ||
GPS location of drone packet. | ||
Attributes: | ||
lat (float): The latitude of the drone. | ||
lon (float): The longitude of the drone. | ||
alt (float): The altitude of the drone. | ||
""" | ||
|
||
lat: float | ||
lon: float | ||
alt: float | ||
|
||
|
||
@dataclass | ||
class EStopPacket(Packet, class_id=0x20, subclass_id=0x03, payload_format=""): | ||
""" | ||
Emergency stop drone packet. | ||
""" | ||
|
||
|
||
@dataclass | ||
class StartPacket(Packet, class_id=0x20, subclass_id=0x04, payload_format="<20s"): | ||
""" | ||
Start drone mission packet. | ||
Attributes: | ||
name (str): The name of the mission to run on the drone. Limited to 20 characters. | ||
""" | ||
|
||
name: str | ||
|
||
|
||
@dataclass | ||
class StopPacket(Packet, class_id=0x20, subclass_id=0x05, payload_format=""): | ||
""" | ||
Stop drone and return packet. | ||
""" | ||
|
||
|
||
class Color(Enum): | ||
""" | ||
Enum to represent the color of a target. | ||
""" | ||
|
||
BLUE = "b" | ||
GREEN = "g" | ||
RED = "r" | ||
|
||
|
||
@dataclass | ||
class TargetPacket(Packet, class_id=0x20, subclass_id=0x06, payload_format="<ffc"): | ||
""" | ||
GPS of drone-identified target packet. | ||
Attributes: | ||
lat (float): The latitude of the target. | ||
lon (float): The longitude of the target. | ||
color (Color): The color of the target. | ||
""" | ||
|
||
lat: float | ||
lon: float | ||
color: Color |
15 changes: 15 additions & 0 deletions
15
NaviGator/hardware_drivers/navigator_drone_comm/package.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0"?> | ||
<package format="2"> | ||
<name>navigator_drone_comm</name> | ||
<version>0.0.0</version> | ||
<description>The navigator_drone_comm package</description> | ||
|
||
<maintainer email="[email protected]">Alex Johnson</maintainer> | ||
|
||
<license>TODO</license> | ||
|
||
<buildtool_depend>catkin</buildtool_depend> | ||
<build_depend>rospy</build_depend> | ||
<build_export_depend>rospy</build_export_depend> | ||
<exec_depend>rospy</exec_depend> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD | ||
|
||
from catkin_pkg.python_setup import generate_distutils_setup | ||
from setuptools import setup | ||
|
||
# Fetch values from package.xml | ||
setup_args = generate_distutils_setup( | ||
packages=["navigator_drone_comm"], | ||
) | ||
|
||
setup(**setup_args) |
42 changes: 42 additions & 0 deletions
42
NaviGator/mission_control/navigator_launch/config/bounds_sarasota_a.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
!!python/object/new:dynamic_reconfigure.encoding.Config | ||
dictitems: | ||
frame: ecef | ||
groups: !!python/object/new:dynamic_reconfigure.encoding.Config | ||
dictitems: | ||
frame: ecef | ||
groups: !!python/object/new:dynamic_reconfigure.encoding.Config | ||
state: [] | ||
id: 0 | ||
name: Default | ||
parameters: !!python/object/new:dynamic_reconfigure.encoding.Config | ||
state: [] | ||
parent: 0 | ||
state: true | ||
type: '' | ||
x1: 744450.0 | ||
x2: 744336.0 | ||
x3: 744342.0 | ||
x4: 744456.0 | ||
y1: -5618775.0 | ||
y2: -5618790.0 | ||
y3: -5618835.0 | ||
y4: -5618820.0 | ||
z1: 2915236.0 | ||
z2: 2915236.0 | ||
z3: 2915150.0 | ||
z4: 2915150.0 | ||
state: [] | ||
x1: 744450.0 | ||
x2: 744336.0 | ||
x3: 744342.0 | ||
x4: 744456.0 | ||
y1: -5618775.0 | ||
y2: -5618790.0 | ||
y3: -5618835.0 | ||
y4: -5618820.0 | ||
z1: 2915236.0 | ||
z2: 2915236.0 | ||
z3: 2915150.0 | ||
z4: 2915150.0 | ||
state: [] |
Oops, something went wrong.