Skip to content
Snippets Groups Projects
Commit d092cc25 authored by Tommy Persson's avatar Tommy Persson
Browse files

Changed how background image is found.

parent 42101faf
No related branches found
No related tags found
No related merge requests found
#include <OGRE/OgreSceneNode.h> #include <OGRE/OgreSceneNode.h>
#include <OGRE/OgreSceneManager.h> #include <OGRE/OgreSceneManager.h>
#include <cstdlib>
#include <tf/transform_listener.h> #include <tf/transform_listener.h>
#include <rviz/visualization_manager.h> #include <rviz/visualization_manager.h>
...@@ -11,6 +13,8 @@ ...@@ -11,6 +13,8 @@
#include <rviz/properties/property.h> #include <rviz/properties/property.h>
#include <rviz/frame_manager.h> #include <rviz/frame_manager.h>
#include "ros/package.h"
#include "image_visual.h" #include "image_visual.h"
#include "image_display.h" #include "image_display.h"
...@@ -54,8 +58,20 @@ namespace lrs_rviz { ...@@ -54,8 +58,20 @@ namespace lrs_rviz {
if ((image_filename == "") || (dx <= 0) || (dy <= 0)) { if ((image_filename == "") || (dx <= 0) || (dy <= 0)) {
return; return;
} }
std::string path = ros::package::getPath("lrs_kdb_base_knowledge");
if (path == "") {
path = std::string(std::getenv("HOME"));
} else {
path = path + "/data/orthos";
}
std::string full_image_filename = path + "/" + image_filename;
ROS_ERROR("full_image_filename: %s", full_image_filename.c_str());
image_visual = new ImageVisual(scene_node_, context_, image_visual = new ImageVisual(scene_node_, context_,
image_filename, dx, dy, full_image_filename, dx, dy,
x_offset, y_offset, z_offset, x_offset, y_offset, z_offset,
this); this);
updateVisualVisible(); updateVisualVisible();
...@@ -154,14 +170,14 @@ namespace lrs_rviz { ...@@ -154,14 +170,14 @@ namespace lrs_rviz {
} }
void ImageDisplay::onEnable() { void ImageDisplay::onEnable() {
load(); load();
image_visual->setVisualVisible( true ); image_visual->setVisualVisible( true );
} }
void ImageDisplay::onDisable() { void ImageDisplay::onDisable() {
image_visual->setVisualVisible( false ); image_visual->setVisualVisible( false );
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment