ros-visualization / visualization_tutorials

Tutorials related to using and extending RViz and interactive_markers.
262 stars 263 forks source link

undefined reference to `rviz::RobotModelDisplay::RobotModelDisplay()` in Librviz Tutorial #35

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hello,

I am trying to add a robot model in Librivz tutorial.

By referring to rviz source code and rviz API document, I come up with the following code:

#include "rviz/default_plugin/robot_model_display.h" rviz::RobotModelDisplay* robot_model_; robot_model_ = new RobotModelDisplay(); manager_->addDisplay(robot_model_, true);

But when I executed catkin_make, I came across the following error:

myviz.cpp:(.text+0x926): undefined reference to rviz::RobotModelDisplay::RobotModelDisplay() make[1]: *** [visualization collect2: error: ld returned 1 exit status

I want to ask how could I modify the CMakeList.txt to make it find RobotModelDisplay. Thanks!

ghost commented 8 years ago

I have found this thread:

http://answers.ros.org/question/191721/librviz-display-sensor_msgslaserscan/

which partly solves this problem. Thank you.