Unverified Commit 7f4cc171 authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub
Browse files

Test Windows integration (#185)

* cmake: sync submodule

* ci: update WIndows

* cmake: sync submodule

* test/python: remove np.matrix usage

* cmake: sync submodule

* ros: update version

* python: use PYTHON_SITELIB for Windows

* cmake: sync submodule

* ci: fix PYTHON_SITELIB

* cmake: sync submodule

* cmake: fix var name
parent 14141399
...@@ -39,19 +39,27 @@ jobs: ...@@ -39,19 +39,27 @@ jobs:
call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64 call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64
:: start building :: Create build
mkdir build mkdir build
pushd build pushd build
:: Configure
set PKG_CONFIG_PATH=%CONDA_PREFIX%\Library\share\pkgconfig:%CONDA_PREFIX%\Library\share\pkgconfig set PKG_CONFIG_PATH=%CONDA_PREFIX%\Library\share\pkgconfig:%CONDA_PREFIX%\Library\share\pkgconfig
cmake ^ cmake ^
-G "Visual Studio 16 2019" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 ^ -G "Visual Studio 16 2019" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 ^
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^ -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
-DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_BUILD_TYPE=Release ^
-DHPP_FCL_SITELIB_ROOT=%CONDA_PREFIX% ^ -DPYTHON_SITELIB=%CONDA_PREFIX%\Lib\site-packages ^
-DPYTHON_EXECUTABLE=%CONDA_PREFIX%\python.exe ^ -DPYTHON_EXECUTABLE=%CONDA_PREFIX%\python.exe ^
-DBUILD_PYTHON_INTERFACE=ON ^ -DBUILD_PYTHON_INTERFACE=ON ^
.. ..
:: Build and Install
cmake --build . --config Release --target install cmake --build . --config Release --target install
:: Testing :: Testing
ctest --output-on-failure -C Release -V ctest --output-on-failure -C Release -V
:: Test Python import
cd ..
python -c "import hppfcl"
Subproject commit 89bd42923644d96fbe99d7495d12021d1e885a83 Subproject commit b76c02edcdcf220a42de9706a0341dc1075dbd04
<?xml version="1.0"?> <?xml version="1.0"?>
<package format="2"> <package format="2">
<name>hpp-fcl</name> <name>hpp-fcl</name>
<version>1.5.1</version> <version>1.5.2</version>
<description>An extension of the Flexible Collision Library.</description> <description>An extension of the Flexible Collision Library.</description>
<!-- The maintainer listed here is for the ROS release to receive emails for the buildfarm. <!-- The maintainer listed here is for the ROS release to receive emails for the buildfarm.
Please check the repository URL for full list of authors and maintainers. --> Please check the repository URL for full list of authors and maintainers. -->
......
...@@ -129,8 +129,8 @@ SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES ...@@ -129,8 +129,8 @@ SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/python/${LIBRARY_NAME}" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/python/${LIBRARY_NAME}"
) )
IF(DEFINED HPP_FCL_SITELIB_ROOT AND HPP_FCL_SITELIB_ROOT) IF(IS_ABSOLUTE ${PYTHON_SITELIB})
SET(${LIBRARY_NAME}_INSTALL_DIR ${HPP_FCL_SITELIB_ROOT}/${PYTHON_SITELIB}/${LIBRARY_NAME}) SET(${LIBRARY_NAME}_INSTALL_DIR ${PYTHON_SITELIB}/${LIBRARY_NAME})
ELSE() ELSE()
SET(${LIBRARY_NAME}_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${PYTHON_SITELIB}/${LIBRARY_NAME}) SET(${LIBRARY_NAME}_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${PYTHON_SITELIB}/${LIBRARY_NAME})
ENDIF() ENDIF()
......
import unittest import unittest
from test_case import TestCase from test_case import TestCase
import hppfcl import hppfcl
hppfcl.switchToNumpyMatrix()
import numpy as np import numpy as np
class TestGeometricShapes(TestCase): class TestGeometricShapes(TestCase):
...@@ -42,14 +41,14 @@ class TestGeometricShapes(TestCase): ...@@ -42,14 +41,14 @@ class TestGeometricShapes(TestCase):
self.assertApprox(Ic, I0_ref) self.assertApprox(Ic, I0_ref)
def test_box1(self): def test_box1(self):
box = hppfcl.Box(np.matrix([1.,2.,3.]).T) box = hppfcl.Box(np.array([1.,2.,3.]))
self.assertIsInstance(box, hppfcl.Box) self.assertIsInstance(box, hppfcl.Box)
self.assertIsInstance(box, hppfcl.ShapeBase) self.assertIsInstance(box, hppfcl.ShapeBase)
self.assertIsInstance(box, hppfcl.CollisionGeometry) self.assertIsInstance(box, hppfcl.CollisionGeometry)
self.assertEqual(box.getNodeType(), hppfcl.NODE_TYPE.GEOM_BOX) self.assertEqual(box.getNodeType(), hppfcl.NODE_TYPE.GEOM_BOX)
self.assertTrue(np.array_equal(box.halfSide,np.matrix([.5,1.,1.5]).T)) self.assertTrue(np.array_equal(box.halfSide,np.array([.5,1.,1.5])))
box.halfSide = np.matrix([4.,5.,6.]).T box.halfSide = np.array([4.,5.,6.])
self.assertTrue(np.array_equal(box.halfSide,np.matrix([4.,5.,6.]).T)) self.assertTrue(np.array_equal(box.halfSide,np.array([4.,5.,6.])))
com = box.computeCOM() com = box.computeCOM()
self.assertApprox(com, np.zeros(3)) self.assertApprox(com, np.zeros(3))
V = box.computeVolume() V = box.computeVolume()
...@@ -135,7 +134,7 @@ class TestGeometricShapes(TestCase): ...@@ -135,7 +134,7 @@ class TestGeometricShapes(TestCase):
self.assertEqual(cone.radius,3.) self.assertEqual(cone.radius,3.)
self.assertEqual(cone.halfLength,4.) self.assertEqual(cone.halfLength,4.)
com = cone.computeCOM() com = cone.computeCOM()
self.assertApprox(com, np.matrix([0.,0.,-0.5 * cone.halfLength]).T) self.assertApprox(com, np.array([0.,0.,-0.5 * cone.halfLength]))
V = cone.computeVolume() V = cone.computeVolume()
V_ref = np.pi * cone.radius**2 * 2. * cone.halfLength / 3. V_ref = np.pi * cone.radius**2 * 2. * cone.halfLength / 3.
self.assertApprox(V, V_ref) self.assertApprox(V, V_ref)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment