Skip to content

Commit

Permalink
Fixed dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
IliTheButterfly committed Apr 22, 2024
1 parent 2c8f325 commit 499ad00
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
3 changes: 0 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ COPY ./ /workspace/$USERNAME/
# Change user
USER $USERNAME

# Install control board dependencies
RUN pip install capra_micro_comm_py@git+https://github.com/clubcapra/capra_micro_comm_py.git@master python-can@git+https://github.com/IliTheButterfly/python-can.git@main --no-input

# Rosdep update
RUN rosdep update
RUN rosdep install --from-paths src --ignore-src --rosdistro humble -y
Expand Down
11 changes: 10 additions & 1 deletion src/rove_control_board/api/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ struct Bounds
static_assert(sizeof(Bounds) == 8);

// --- COMMANDS ---
Int ping(Int);
static_assert((sizeof(Int)+1) == 5);

ULong hashCheck(Void);
static_assert((sizeof(Void)+1) == 2);

Bool_ setServoPosition(Vector2D);
static_assert((sizeof(Vector2D)+1) == 9);

Expand Down Expand Up @@ -181,6 +187,8 @@ Report getReport(Void);
static_assert((sizeof(Void)+1) == 2);

static BaseFunction_ptr commands[] = {
new Function<Int, Int>(&ping),
new Function<ULong, Void>(&hashCheck),
new Function<Bool_, Vector2D>(&setServoPosition),
new Function<Vector2D, Void>(&getServoPosition),
new Function<Bool_, Void>(&setServoPositionZero),
Expand All @@ -202,6 +210,7 @@ static BaseFunction_ptr commands[] = {
new Function<Bool_, Void>(&getLEDStrobe),
new Function<Report, Void>(&getReport),
};
#define COMMANDS_COUNT 20
#define COMMANDS_COUNT 22
#define MAX_DECODED_SIZE 17
#define MAX_ENCODED_SIZE 25
#define API_HASH 9203740187175752639UL
26 changes: 18 additions & 8 deletions src/rove_control_board/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
['resource/' + package_name]),
('share/' + package_name, ['package.xml']),
],
install_requires=[
install_requires=[ # ROS2 does not follow the python setup procedure. Dependencies added here won't be installed
'setuptools',
'capra_micro_comm_py@git+https://github.com/clubcapra/capra_micro_comm_py.git@master', # THIS ISN'T WORKING...
'python-can'
'capra_micro_comm_py@git+https://github.com/clubcapra/capra_micro_comm_py.git@master',
'python-can@git+https://github.com/IliTheButterfly/python-can.git@main',
],
# requires=['capra_micro_comm_py@git+https://github.com/clubcapra/capra_micro_comm_py.git@master'],
zip_safe=True,
Expand All @@ -37,12 +37,22 @@
# This works but I hate it and I want it to burn and die...
# i dont like it
# - Iliana
# try:
# import capra_micro_comm_py
# except ImportError:
# pip.main(['install', 'capra_micro_comm_py@git+https://github.com/clubcapra/capra_micro_comm_py.git@master', '--no-input', '--quiet'])
try:
import capra_micro_comm_py
except ImportError:
try:
import can
pip.main(['uninstall', 'python-can', '--no-input', '-y', '--quiet'])
except ImportError:
pass
pip.main(['install', 'capra_micro_comm_py@git+https://github.com/clubcapra/capra_micro_comm_py.git@master', 'python-can@git+https://github.com/IliTheButterfly/python-can.git@main', '--no-input', '--quiet'])

# FYI, to remove this package, run `pip uninstall capra_micro_comm_py`
try:
import can
except ImportError:
pip.main(['install', 'python-can@git+https://github.com/IliTheButterfly/python-can.git@main', '--no-input', '--quiet'])

# FYI, to remove this package, run `pip uninstall capra_micro_comm_py python-can`


# Generate the micro comm api for the control board
Expand Down

0 comments on commit 499ad00

Please sign in to comment.