Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/rviz_camera_stream/camera_display.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class IntProperty;
class RenderPanel;
class RosTopicProperty;
class DisplayGroupVisibilityProperty;
class ColorProperty;

/**
* \class CameraPub
Expand Down Expand Up @@ -104,6 +105,7 @@ private Q_SLOTS:
void updateTopic();
virtual void updateQueueSize();
virtual void updateFrameRate();
virtual void updateBackgroundColor();

private:
void subscribe();
Expand All @@ -128,6 +130,7 @@ private Q_SLOTS:
DisplayGroupVisibilityProperty* visibility_property_;
IntProperty* queue_size_property_;
FloatProperty* frame_rate_property_;
ColorProperty* background_color_property_;

sensor_msgs::CameraInfo::ConstPtr current_caminfo_;
boost::mutex caminfo_mutex_;
Expand Down
10 changes: 10 additions & 0 deletions src/camera_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <rviz/properties/float_property.h>
#include <rviz/properties/int_property.h>
#include <rviz/properties/ros_topic_property.h>
#include <rviz/properties/color_property.h>
#include <rviz/uniform_string_stream.h>
#include <rviz/validate_floats.h>
#include <OgreCamera.h>
Expand Down Expand Up @@ -190,6 +191,10 @@ CameraPub::CameraPub()
"trigger single images with the /rviz_camera_trigger service.",
this, SLOT(updateFrameRate()));
frame_rate_property_->setMin(-1);

background_color_property_ = new ColorProperty("Background Color", Qt::black,
"Sets background color, values from 0.0 to 1.0.",
this, SLOT(updateBackgroundColor()));
}

CameraPub::~CameraPub()
Expand Down Expand Up @@ -291,6 +296,7 @@ void CameraPub::postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt)
}
trigger_activated_ = false;
last_image_publication_time_ = cur_time;
render_texture_->getViewport(0)->setBackgroundColour(background_color_property_->getOgreColor());

std::string frame_id;
{
Expand Down Expand Up @@ -374,6 +380,10 @@ void CameraPub::updateFrameRate()
{
}

void CameraPub::updateBackgroundColor()
{
}

void CameraPub::clear()
{
force_render_ = true;
Expand Down