rviz_ogre_vendor and system Ogre are interfering

asked 2021-11-03 13:17:45 -0500

DavidMerzJr gravatar image

I am trying to port an RViz display / plugin from ROS1 Noetic to ROS2 Foxy. It uses a variety of both RViz and OGRE types. It appears that RViz2 uses a custom OGRE version (1.12.1) which differs significantly from my system version (1.9.0). OGRE types/headers 'inherited' from RViz link to the custom OGRE from rviz_ogre_vendor, as one would expect. Somehow, direct includes of OGRE types/headers link to my system install. How does one force a library to use the OGRE version from rviz_ogre_vendor?

Packages Used libogre-1.9-dev 1.9.0 libogre-1.9.0v5 1.9.0 ros-foxy-rviz-ogre-vendor 8.2.5-1

Platform Ubuntu 20.04 Focal Fossa amd64 architecture

Build Error

In file included from /opt/ros/foxy/opt/rviz_ogre_vendor/include/OGRE/OgreVector3.h:1,
                 from /opt/ros/foxy/include/rviz_common/frame_manager_iface.hpp:45,
                 from /opt/ros/foxy/include/rviz_common/display_context.hpp:42,
                 from /home/user/workspace/src/my_pkg/src/my_plugin.cpp:59:
/opt/ros/foxy/opt/rviz_ogre_vendor/include/OGRE/OgreVector.h: In member function ‘Ogre::Radian Ogre::VectorBase<2, float>::angleTo(const Ogre::Vector2&) const’:
/opt/ros/foxy/opt/rviz_ogre_vendor/include/OGRE/OgreVector.h:767:26: error: cannot convert ‘const Ogre::Vector2’ to ‘const Ogre::VectorBase<2, float>&’
  767 |         if (crossProduct(other)<0)
      |                          ^~~~~
      |                          |
      |                          const Ogre::Vector2
In file included from /opt/ros/foxy/opt/rviz_ogre_vendor/include/OGRE/OgreVector3.h:1,
                 from /opt/ros/foxy/include/rviz_common/frame_manager_iface.hpp:45,
                 from /opt/ros/foxy/include/rviz_common/display_context.hpp:42,
                 from /home/user/workspace/src/my_pkg/src/my_file.cpp:59:
/opt/ros/foxy/opt/rviz_ogre_vendor/include/OGRE/OgreVector.h:89:46: note:   initializing argument 1 of ‘Ogre::Real Ogre::VectorBase<2, float>::crossProduct(const Ogre::VectorBase<2, float>&) const’
   89 |         Real crossProduct( const VectorBase& rkVector ) const
      |                            ~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from /opt/ros/foxy/opt/rviz_ogre_vendor/include/OGRE/OgreVector3.h:1,
                 from /opt/ros/foxy/include/rviz_common/frame_manager_iface.hpp:45,
                 from /opt/ros/foxy/include/rviz_common/display_context.hpp:42,
                 from /home/user/workspace/src/my_pkg/src/my_file.cpp:59:
/opt/ros/foxy/opt/rviz_ogre_vendor/include/OGRE/OgreVector.h: In member function ‘Ogre::Quaternion Ogre::VectorBase<3, float>::getRotationTo(const Ogre::Vector3&, const Ogre::Vector3&) const’:
/opt/ros/foxy/opt/rviz_ogre_vendor/include/OGRE/OgreVector.h:832:38: error: cannot convert ‘const Ogre::VectorBase<3, float>’ to ‘const Ogre::Vector3&’
  832 |         Real b = a + dest.dotProduct(*this);
      |                                      ^~~~~
      |                                      |
      |                                      const Ogre::VectorBase<3, float>
In file included from /usr/include/OGRE/OgreMatrix3.h:33,
                 from /usr/include/OGRE/OgreNode.h:34,
                 from /usr/include/OGRE/OgreSceneNode.h:33,
                 from /usr/include/OGRE/OgreSceneManager.h:37,
                 from /usr/include/OGRE/OgreSceneManagerEnumerator.h:33,
                 from /usr/include/OGRE/OgreRoot.h:36,
                 from /home/user/workspace/src/my_pkg/include/my_pkg/my_plugin.h:47,
                 from /home/user/workspace/src/my_pkg/src/my_plugin.cpp:40:
/usr/include/OGRE/OgreVector3.h:417:47: note:   initializing argument 1 of ‘Ogre::Real Ogre::Vector3::dotProduct(const Ogre::Vector3&) const’
  417 |         inline Real dotProduct(const Vector3& vec) const
      |                                ~~~~~~~~~~~~~~~^~~
In file included from /opt/ros/foxy/opt/rviz_ogre_vendor/include/OGRE/OgreVector3.h:1,
                 from /opt/ros/foxy/include ...
(more)
edit retag flag offensive close merge delete