-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from westonrobot/feature-python_bindings
Feature python bindings
- Loading branch information
Showing
25 changed files
with
1,291 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Pybind | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-22.04, ubuntu-20.04 ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Install dependencies | ||
run: sudo apt-get install -y build-essential cmake libasio-dev python3-dev | ||
- name: Build python package | ||
run: python setup.py build_ext --inplace |
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "test/googletest"] | ||
path = test/googletest | ||
url = https://github.com/google/googletest.git | ||
[submodule "python/pybind11"] | ||
path = python/pybind11 | ||
url = https://github.com/pybind/pybind11.git |
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,9 @@ | ||
include CMakeLists.txt | ||
include LICENSE | ||
include README.md | ||
include package.xml | ||
recursive-include sample * | ||
recursive-include cmake * | ||
recursive-include include * | ||
recursive-include src * | ||
recursive-include python * |
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
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,2 @@ | ||
add_subdirectory(pybind11) | ||
add_subdirectory(ugv_sdk_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,17 @@ | ||
pybind11_add_module(ugv_sdk_py | ||
src/ugv_sdk_py.cpp | ||
src/agilex_message.cpp | ||
src/scout_robot.cpp | ||
src/hunter_robot.cpp | ||
src/ranger_robot.cpp | ||
) | ||
target_link_libraries(ugv_sdk_py PRIVATE ugv_sdk) | ||
target_include_directories(ugv_sdk_py PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
$<INSTALL_INTERFACE:include> | ||
PRIVATE src) | ||
set(PYBIND_OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR} CACHE PATH "Output directory for pybind libraries") | ||
message(STATUS " - To install pybind components to ${PYBIND_OUTPUT_LIBDIR}") | ||
set_target_properties(ugv_sdk_py PROPERTIES | ||
LIBRARY_OUTPUT_DIRECTORY ${PYBIND_OUTPUT_LIBDIR} | ||
) |
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,28 @@ | ||
/* | ||
* agilex_message.hpp | ||
* | ||
* Created on 5/8/24 7:36 PM | ||
* Description: | ||
* | ||
* Copyright (c) 2024 Weston Robot Pte. Ltd. | ||
*/ | ||
|
||
#ifndef UGV_SDK_AGILEX_MESSAGE_HPP | ||
#define UGV_SDK_AGILEX_MESSAGE_HPP | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace westonrobot { | ||
void BindProtocolVersion(pybind11::module &m); | ||
void BindSystemStateMessage(pybind11::module &m); | ||
void BindMotionStateMessage(pybind11::module &m); | ||
void BindLightStateMessage(pybind11::module &m); | ||
void BindRcStateMessage(pybind11::module &m); | ||
void BindActuatorHSStateMessage(pybind11::module &m); | ||
void BindActuatorLSStateMessage(pybind11::module &m); | ||
void BindActuatorStateMessageV1(pybind11::module &m); | ||
void BindMotionModeStateMessage(pybind11::module &m); | ||
void BindBmsBasicMessage(pybind11::module &m); | ||
} | ||
|
||
#endif //UGV_SDK_AGILEX_MESSAGE_HPP |
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,19 @@ | ||
/** | ||
* @file hunter_robot.hpp | ||
* @brief | ||
* @date 28-05-2024 | ||
* | ||
* hunter_robot submodule for ugv_sdk_py | ||
* | ||
* @copyright Copyright (c) 2024 Weston Robot Pte. Ltd. | ||
*/ | ||
#ifndef UGV_SDK_PY_HUNTER_ROBOT_HPP | ||
#define UGV_SDK_PY_HUNTER_ROBOT_HPP | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace westonrobot { | ||
void BindHunterRobot(pybind11::module &m); | ||
} | ||
|
||
#endif /* UGV_SDK_PY_HUNTER_ROBOT_HPP */ |
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,19 @@ | ||
/** | ||
* @file ranger_robot.hpp | ||
* @brief | ||
* @date 28-05-2024 | ||
* | ||
* ranger_robot submodule for ugv_sdk_py | ||
* | ||
* @copyright Copyright (c) 2024 Weston Robot Pte. Ltd. | ||
*/ | ||
#ifndef UGV_SDK_PY_RANGER_ROBOT_HPP | ||
#define UGV_SDK_PY_RANGER_ROBOT_HPP | ||
#include <pybind11/pybind11.h> | ||
|
||
namespace westonrobot { | ||
void BindRangerRobot(pybind11::module &m); | ||
} | ||
|
||
|
||
#endif /* UGV_SDK_PY_RANGER_ROBOT_HPP */ |
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,19 @@ | ||
/** | ||
* @file scout_robot.hpp | ||
* @brief | ||
* @date 28-05-2024 | ||
* | ||
* scout_robot submodule for ugv_sdk_py | ||
* | ||
* @copyright Copyright (c) 2024 Weston Robot Pte. Ltd. | ||
*/ | ||
#ifndef UGV_SDK_PY_SCOUT_ROBOT_HPP | ||
#define UGV_SDK_PY_SCOUT_ROBOT_HPP | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace westonrobot { | ||
void BindScoutRobot(pybind11::module &m); | ||
} | ||
|
||
#endif /* UGV_SDK_PY_SCOUT_ROBOT_HPP */ |
Oops, something went wrong.