gazebosim / gz-physics

Abstract physics interface designed to support simulation and rapid development of robot applications.
https://gazebosim.org
Apache License 2.0
63 stars 38 forks source link

Compile error for AABBTree.cc #595

Closed bchoineubility closed 4 months ago

bchoineubility commented 5 months ago

Hi,

I have tried to build ignition-physics5-5.3.2 with Yocto system for ROS2. But, I have some errors as follows.

| /home/bchoi/nvidia-yocto-bsp/bchoi-build/tmp/work/armv8a-oe4t-linux/ignition-physics5/5.3.2-r0/git/tpe/lib/src/AABBTree.cc:44:17: error: 'gz' is not a namespace-name
|    44 | using namespace gz;
|       |                 ^~
| /home/bchoi/nvidia-yocto-bsp/bchoi-build/tmp/work/armv8a-oe4t-linux/ignition-physics5/5.3.2-r0/git/tpe/lib/src/AABBTree.cc:45:17: error: 'physics' is not a namespace-name
|    45 | using namespace physics;
|       |                 ^~~~~~~
| /home/bchoi/nvidia-yocto-bsp/bchoi-build/tmp/work/armv8a-oe4t-linux/ignition-physics5/5.3.2-r0/git/tpe/lib/src/AABBTree.cc:46:17: error: 'tpelib' is not a namespace-name
|    46 | using namespace tpelib;
|       |                 ^~~~~~
| /home/bchoi/nvidia-yocto-bsp/bchoi-build/tmp/work/armv8a-oe4t-linux/ignition-physics5/5.3.2-r0/git/tpe/lib/src/AABBTree.cc:49:1: error: 'AABBTree' does not name a type
|    49 | AABBTree::AABBTree()
|       | ^~~~~~~~
| /home/bchoi/nvidia-yocto-bsp/bchoi-build/tmp/work/armv8a-oe4t-linux/ignition-physics5/5.3.2-r0/git/tpe/lib/src/AABBTree.cc:56:1: error: 'AABBTree' does not name a type
|    56 | AABBTree::~AABBTree() = default;
|       | ^~~~~~~~
| /home/bchoi/nvidia-yocto-bsp/bchoi-build/tmp/work/armv8a-oe4t-linux/ignition-physics5/5.3.2-r0/git/tpe/lib/src/AABBTree.cc:59:6: error: 'AABBTree' has not been declared
|    59 | void AABBTree::AddNode(std::size_t _id, const math::AxisAlignedBox &_aabb)
|       |      ^~~~~~~~
| /home/bchoi/nvidia-yocto-bsp/bchoi-build/tmp/work/armv8a-oe4t-linux/ignition-physics5/5.3.2-r0/git/tpe/lib/src/AABBTree.cc:59:47: error: 'math' does not name a type
|    59 | void AABBTree::AddNode(std::size_t _id, const math::AxisAlignedBox &_aabb)
|       |                                               ^~~~
| /home/bchoi/nvidia-yocto-bsp/bchoi-build/tmp/work/armv8a-oe4t-linux/ignition-physics5/5.3.2-r0/git/tpe/lib/src/AABBTree.cc:59:68: error: expected unqualified-id before '&' token
|    59 | void AABBTree::AddNode(std::size_t _id, const math::AxisAlignedBox &_aabb)
|       |                                                                    ^
| /home/bchoi/nvidia-yocto-bsp/bchoi-build/tmp/work/armv8a-oe4t-linux/ignition-physics5/5.3.2-r0/git/tpe/lib/src/AABBTree.cc:59:67: error: expected ')' before '&' token
|    59 | void AABBTree::AddNode(std::size_t _id, const math::AxisAlignedBox &_aabb)
|       |                       ~                                           ^~
|       |                                                                   )

I think AABBTree.cc could not find required namespaces in the build system, such as gz, physics. I could not find where they are defined yet.

Can you please help me fix these error?

BR, Mark

bchoineubility commented 5 months ago

Hi

I made some progress for this issue. I think problem is namespace change from ignition to gz for tpe would not complete yet.

config.hh have gz namespace and it can be refered by ignition/physics/tpelib/Export.hh but, tpe have "gz/physics/tpelib/Export.h" and it even don't define include dir for it in the CMakeLists.txt.

I attached my patch for it and check it it correct.

0001-Fixed-compile-error-for-tpelib.patch

BR, Mark

azeey commented 4 months ago

gz-physics 5.3.2 needs gz-math 6.13.0 or newer. Fix in https://github.com/gazebosim/gz-physics/pull/601