Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New python interface with documentation #34

Merged
merged 22 commits into from
Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c70ef5d
Working on including documentation in the python library. Also refres…
MatteoRagni Oct 18, 2021
3032833
Completed base curve wrapping
MatteoRagni Oct 19, 2021
de542c3
:snake: Working on biarc wrapper
MatteoRagni Oct 19, 2021
dbacf64
:snake: A more python copy concept for Biarc
MatteoRagni Oct 19, 2021
acbdd9f
Merge branch 'bugfix/biarc_list_memory' into develop
MatteoRagni Oct 19, 2021
bd0bad3
:snake: revision of BiarcList wrapper (and Biarc)
MatteoRagni Oct 19, 2021
c01e629
:snake: G2lib has a __version__ attribute
MatteoRagni Oct 19, 2021
cccd831
:snake: refreshed wrapper for Circle Arc
MatteoRagni Oct 19, 2021
a62e41a
Merge remote-tracking branch 'upstream/develop' into develop
MatteoRagni Oct 20, 2021
72c33a7
:snake: minor fixes in biarc docs
MatteoRagni Oct 20, 2021
b139a0a
:snake: full remake of the LineSegment and PolyLine interfaces
MatteoRagni Oct 20, 2021
b9b1deb
:snake: full remake for Triangle2d wrapper
MatteoRagni Oct 20, 2021
f549d8b
:snake: full remake of the interface for Clothoids and ClothoidsList
MatteoRagni Oct 20, 2021
a2f4814
:snake: const correctness in trinagle2d
MatteoRagni Oct 20, 2021
7f78f5f
:snake: minor fix in clothoids
MatteoRagni Oct 20, 2021
b6dc95b
:snake: Reimporting some stuff from antemotion repository
MatteoRagni Oct 20, 2021
1a89bc6
:snake: Fixes an error in const requirements for ClothoidList::load
MatteoRagni Oct 20, 2021
e0b427d
Fixes a segmentation fault on ClothoidList::length for empty list
MatteoRagni Oct 20, 2021
2c72ff2
:snake: Several improvements to interface and vectorial version of me…
MatteoRagni Oct 21, 2021
c490850
git submodules now are CI complaint
MatteoRagni Oct 21, 2021
f3d9ca3
Fix to minor cmake stuff, that raise an error on some platform
MatteoRagni Oct 21, 2021
1223e24
:snake: Fixes segmentation fault on getXY for clothoidList and Biarc
MatteoRagni Oct 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 115 additions & 24 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,129 @@
linux_builds:
linux_python3_7:
tags:
- linux
only:
- develop
image: matteoragni/clothoids.build.antemotion.com:latest
before_script:
- apt install -y --no-install-recommends --no-install-suggests python3-pytest
script:
- |
cd src_py
mkdir build3.6
cd build3.6
cmake -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3.6 ..
mkdir build
cd build
cmake -DPYTHON_EXECUTABLE:FILEPATH=$PYTHON_BIN ..
make
cd ..
/usr/bin/python3.6 test
mkdir -p $CI_PROJECT_DIR/releases/linux/python3.6
cp build3.6/G2lib.cpython-36m-x86_64-linux-gnu.so $CI_PROJECT_DIR/releases/linux/python3.6
mkdir build3.7
cd build3.7
cmake -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3.7 ..
$PYTHON_BIN -m pytest --junitxml=$TEST_REPORT $CI_PROJECT_DIR/src_py/test
cp $PRODUCT_NAME $CI_PROJECT_DIR
artifacts:
paths:
- $PRODUCT_NAME
reports:
junit: $TEST_REPORT
variables:
GIT_SUBMODULE_STRATEGY: recursive
PYTHON_BIN: /usr/bin/python3.7
PRODUCT_NAME: G2lib.cpython-37m-x86_64-linux-gnu.so
TEST_REPORT: $CI_PROJECT_DIR/test_report.xml

linux_python3_6:
tags:
- linux
only:
- develop
image: matteoragni/clothoids.build.antemotion.com:latest
before_script:
- apt install -y --no-install-recommends --no-install-suggests python3-pytest
script:
- |
cd src_py
mkdir build
cd build
cmake -DPYTHON_EXECUTABLE:FILEPATH=$PYTHON_BIN ..
make
cd ..
/usr/bin/python3.7 test
mkdir -p $CI_PROJECT_DIR/releases/linux/python3.7
cp build3.7/G2lib.cpython-37m-x86_64-linux-gnu.so $CI_PROJECT_DIR/releases/linux/python3.7
mkdir build2.7
cd build2.7
cmake -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python2.7 ..
$PYTHON_BIN -m pytest --junitxml=$TEST_REPORT $CI_PROJECT_DIR/src_py/test
cp $PRODUCT_NAME $CI_PROJECT_DIR
artifacts:
paths:
- $PRODUCT_NAME
reports:
junit: $TEST_REPORT
variables:
GIT_SUBMODULE_STRATEGY: recursive
PYTHON_BIN: /usr/bin/python3.6
PRODUCT_NAME: G2lib.cpython-36m-x86_64-linux-gnu.so
TEST_REPORT: $CI_PROJECT_DIR/test_report.xml

linux_python2_7:
tags:
- linux
only:
- develop
image: matteoragni/clothoids.build.antemotion.com:latest
before_script:
- apt install -y --no-install-recommends --no-install-suggests python-pytest
script:
- |
cd src_py
mkdir build
cd build
cmake -DPYTHON_EXECUTABLE:FILEPATH=$PYTHON_BIN ..
make
cd ..
/usr/bin/python2.7 test
mkdir -p $CI_PROJECT_DIR/releases/linux/python2.7
cp build2.7/G2lib.so $CI_PROJECT_DIR/releases/linux/python2.7
$PYTHON_BIN -m pytest --junitxml=$TEST_REPORT $CI_PROJECT_DIR/src_py/test
cp $PRODUCT_NAME $CI_PROJECT_DIR
artifacts:
paths:
- $PRODUCT_NAME
reports:
junit: $TEST_REPORT
variables:
GIT_SUBMODULE_STRATEGY: recursive
PYTHON_BIN: /usr/bin/python2.7
PRODUCT_NAME: G2lib.so
TEST_REPORT: $CI_PROJECT_DIR/test_report.xml

windows_python3_7:
tags:
- win
only:
- develop
script:
- |
cd src_py
mkdir build
cd build
cmake -DPYTHON_EXECUTABLE:FILEPATH=$PYTHON_BIN -A x64 ..
cmake --build . --config Release
py.exe -3 -m pytest --junitxml=$TEST_REPORT $CI_PROJECT_DIR/src_py/test
cp Release/$PRODUCT_NAME $CI_PROJECT_DIR
artifacts:
paths:
- $PRODUCT_NAME
variables:
GIT_SUBMODULE_STRATEGY: recursive
PYTHON_BIN: C:\Python37\python.exe
PRODUCT_NAME: G2lib.cp37-win_amd64.pyd
TEST_REPORT: $CI_PROJECT_DIR/test_report.xml

windows_python2_7:
tags:
- win
only:
- develop
script:
- |
cd src_py
mkdir build
cd build
cmake -DPYTHON_EXECUTABLE:FILEPATH=$PYTHON_BIN -A x64 ..
cmake --build . --config Release
py.exe -2 -m pytest --junitxml=$TEST_REPORT $CI_PROJECT_DIR/src_py/test
cp Release/$PRODUCT_NAME $CI_PROJECT_DIR
artifacts:
paths:
- releases
- $PRODUCT_NAME
variables:
GIT_SUBMODULE_STRATEGY: recursive
GIT_SUBMODULE_STRATEGY: recursive
PYTHON_BIN: C:\Python27\python.exe
PRODUCT_NAME: G2lib.pyd
TEST_REPORT: $CI_PROJECT_DIR/test_report.xml
7 changes: 5 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[submodule "submodules/Utils"]
path = submodules/Utils
url = git@github.com:ebertolazzi/Utils.git
url = https://github.com/ebertolazzi/Utils.git
[submodule "submodules/quarticRootsFlocke"]
path = submodules/quarticRootsFlocke
url = git@github.com:ebertolazzi/quarticRootsFlocke.git
url = https://github.com/ebertolazzi/quarticRootsFlocke.git
[submodule "submodules/GenericContainer"]
path = submodules/GenericContainer
url = https://github.com/ebertolazzi/GenericContainer.git
1 change: 1 addition & 0 deletions CMakeInstall.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ configure_package_config_file(
)
write_basic_package_version_file(
"ClothoidsConfigVersion.cmake"
VERSION 2.0.9
COMPATIBILITY SameMajorVersion
)
install(
Expand Down
5 changes: 4 additions & 1 deletion src/ClothoidList.cc
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,10 @@ namespace G2lib {

real_type
ClothoidList::length() const
{ return m_s0.back() - m_s0.front(); }
{
if ( m_clotoidList.empty() ) return 0.0;
return m_s0.back() - m_s0.front();
}

real_type
ClothoidList::length_ISO( real_type offs ) const {
Expand Down
6 changes: 2 additions & 4 deletions src_py/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ set(G2LIB_SOURCES
"src/python-ClothoidSpline-IpoptSolver.cc"
"src/python-ClothoidSpline-Interpolation.cc")

pybind11_add_module(${PROJECT_NAME} MODULE ${G2LIB_SOURCES} NO_EXTRAS)
pybind11_add_module(${PROJECT_NAME} MODULE ${G2LIB_SOURCES})

target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14)
target_link_libraries(${PROJECT_NAME} PRIVATE ClothoidsStatic)
target_link_libraries(${PROJECT_NAME} PRIVATE ClothoidsStatic UtilsStatic QuarticStatic)
if (ipopt_FOUND)
target_compile_definitions(${PROJECT_NAME} PRIVATE IPOPT_CLOTHOID_SPLINE)
target_include_directories(${PROJECT_NAME} PRIVATE ${ipopt_INCLUDE_DIRS})
Expand All @@ -57,7 +57,5 @@ if (TARGET Eigen3::Eigen)
endif()
target_assign_flags(${PROJECT_NAME})



set(INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/../lib/lib)
install(TARGETS ${PROJECT_NAME} DESTINATION ${INSTALL_PREFIX})
9 changes: 9 additions & 0 deletions src_py/include/python-G2libHeaders.hh
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,12 @@

#pragma once
#include "Clothoids.hh"

#ifdef _WIN32
#ifdef min
#undef min
#endif
#ifdef max
#undef max
#endif
#endif
Loading