From 499ad00590c0d6d10c5c323fba5273156c2e1250 Mon Sep 17 00:00:00 2001 From: ilithebutterfly Date: Mon, 22 Apr 2024 12:49:26 -0400 Subject: [PATCH] Fixed dependencies --- .devcontainer/Dockerfile | 3 --- src/rove_control_board/api/api.h | 11 ++++++++++- src/rove_control_board/setup.py | 26 ++++++++++++++++++-------- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 56c9b25..c22c8d2 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -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 diff --git a/src/rove_control_board/api/api.h b/src/rove_control_board/api/api.h index 0b29565..0d4928c 100644 --- a/src/rove_control_board/api/api.h +++ b/src/rove_control_board/api/api.h @@ -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); @@ -181,6 +187,8 @@ Report getReport(Void); static_assert((sizeof(Void)+1) == 2); static BaseFunction_ptr commands[] = { + new Function(&ping), + new Function(&hashCheck), new Function(&setServoPosition), new Function(&getServoPosition), new Function(&setServoPositionZero), @@ -202,6 +210,7 @@ static BaseFunction_ptr commands[] = { new Function(&getLEDStrobe), new Function(&getReport), }; -#define COMMANDS_COUNT 20 +#define COMMANDS_COUNT 22 #define MAX_DECODED_SIZE 17 #define MAX_ENCODED_SIZE 25 +#define API_HASH 9203740187175752639UL \ No newline at end of file diff --git a/src/rove_control_board/setup.py b/src/rove_control_board/setup.py index 8709bbb..9c0a49c 100644 --- a/src/rove_control_board/setup.py +++ b/src/rove_control_board/setup.py @@ -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, @@ -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