-
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.
navigator_ball_launcher: Create ball launcher package, add packets us…
…ed to communicate with board to docs
- Loading branch information
Showing
7 changed files
with
108 additions
and
3 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
NaviGator/hardware_drivers/navigator_ball_launcher/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_ball_launcher) | ||
|
||
find_package(catkin REQUIRED COMPONENTS | ||
rospy | ||
) | ||
|
||
catkin_python_setup() | ||
|
||
catkin_package( | ||
) | ||
if(CATKIN_ENABLE_TESTING) | ||
find_package(rostest REQUIRED) | ||
endif() |
7 changes: 7 additions & 0 deletions
7
NaviGator/hardware_drivers/navigator_ball_launcher/navigator_ball_launcher/__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,7 @@ | ||
""" | ||
The :mod:`navigator_ball_launcher` module is used to control the ball launcher | ||
on NaviGator. The module implements the electrical protocol to communicate with | ||
a board that controls the flywheel and servo to drop the balls. | ||
""" | ||
|
||
from .packets import ReleaseBallPacket, SetSpinPacket |
35 changes: 35 additions & 0 deletions
35
NaviGator/hardware_drivers/navigator_ball_launcher/navigator_ball_launcher/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,35 @@ | ||
from dataclasses import dataclass | ||
|
||
from electrical_protocol import Packet | ||
|
||
|
||
@dataclass | ||
class ReleaseBallPacket(Packet, class_id=0x11, subclass_id=0x00, payload_format=""): | ||
""" | ||
Packet sent by the motherboard to the board to release a ball (aka, spin the servo | ||
such that one ball is released.) | ||
A valid response to this packet being sent would be :class:`~electrical_protocol.AckPacket` | ||
(if the ball was successfully released) or :class:`~electrical_protocol.NackPacket` | ||
(if there was an issue). | ||
""" | ||
|
||
pass | ||
|
||
|
||
@dataclass | ||
class SetSpinPacket(Packet, class_id=0x11, subclass_id=0x01, payload_format="<B"): | ||
""" | ||
Packet sent by the motherboard to the board to spin up the flywheel. | ||
A valid response to this packet being sent would be :class:`~electrical_protocol.AckPacket` | ||
(if the flywheel was successfully spun up) or :class:`~electrical_protocol.NackPacket` | ||
(if there was an issue). | ||
Attributes: | ||
spin_up (bool): A boolean used to represent whether the flywheel should | ||
be spun up (aka, sped up to a fast rpm) or whether it should be spun | ||
down (aka, slowed to zero rpm). | ||
""" | ||
|
||
spin_up: bool |
12 changes: 12 additions & 0 deletions
12
NaviGator/hardware_drivers/navigator_ball_launcher/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,12 @@ | ||
<?xml version="1.0"?> | ||
<package> | ||
<name>navigator_ball_launcher</name> | ||
<version>1.0.0</version> | ||
<description>The navigator_ball_launcher package</description> | ||
<maintainer email="cameron.brown@todo.todo">Cameron Brown</maintainer> | ||
<license>MIT</license> | ||
<buildtool_depend>catkin</buildtool_depend> | ||
<build_depend>rospy</build_depend> | ||
<run_depend>rospy</run_depend> | ||
<export/> | ||
</package> |
11 changes: 11 additions & 0 deletions
11
NaviGator/hardware_drivers/navigator_ball_launcher/setup.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,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_ball_launcher"], | ||
) | ||
|
||
setup(**setup_args) |
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