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

Open3d #24

Open
0xd1ma opened this issue Mar 11, 2021 · 3 comments
Open

Open3d #24

0xd1ma opened this issue Mar 11, 2021 · 3 comments

Comments

@0xd1ma
Copy link

0xd1ma commented Mar 11, 2021

Hello
I would like to use open3D in one of my robotics projects under ROS.
Unfortunately, then i add to yaml/cmake.yaml:

open3d:
  components: []
  name: Open3D
  include_dirs: [Open3D_INCLUDE_DIRS]
  libraries: [Open3D_LIBRARIES]
  library_dirs: [Open3D_LIBRARY_DIRS]

and generate cmake by mrt.

it is possible to build simple code:

#include "open3d/Open3D.h"

int main(int argc, char** argv)
{
    using namespace open3d;

    auto sphere = geometry::TriangleMesh::CreateSphere(1.0);
    sphere->ComputeVertexNormals();
    sphere->PaintUniformColor({ 0.0, 1.0, 0.0 });
    visualization::DrawGeometries({ sphere });

    return 0;
}

but then i try to add ROS:

#include <ros/ros.h>
#include "open3d/Open3D.h"

int main(int argc, char** argv)
{
    using namespace open3d;

    ros::init(argc, argv, "map_loader");

    auto sphere = geometry::TriangleMesh::CreateSphere(1.0);
    sphere->ComputeVertexNormals();
    sphere->PaintUniformColor({ 0.0, 1.0, 0.0 });
    visualization::DrawGeometries({ sphere });

    return 0;
}

i have:

undefined reference to ros::init(int&, char**, std::string const&, unsigned int)

is it possible to help me with such an issue?

@poggenhans
Copy link
Contributor

Looks like your package.xml is missing a dependency to roscpp?

@0xd1ma
Copy link
Author

0xd1ma commented Mar 12, 2021

no

in package.xml

  <depend>roscpp</depend>
  <depend>sensor_msgs</depend>
  <depend>pcl_ros</depend>
  <depend>open3d</depend>

@BaltashovIlia
Copy link

Hi,

This issue is not related to mrt_cmake_modules, but related to Open3d compilation settings. For details, see here: ros-perception/perception_open3d#16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants