Commit d390b54a authored by Fernando Herrero's avatar Fernando Herrero
Browse files

Change name to iri_image_inverter

parent d9e1ceb9
cmake_minimum_required(VERSION 2.8.3)
project(iri_image_modifier)
project(iri_image_inverter)
## Find catkin macros and libraries
find_package(catkin REQUIRED)
......@@ -49,7 +49,7 @@ find_package(catkin REQUIRED COMPONENTS iri_base_algorithm cv_bridge image_trans
# ********************************************************************
# Add the dynamic reconfigure file
# ********************************************************************
generate_dynamic_reconfigure_options(cfg/ImageModifier.cfg)
generate_dynamic_reconfigure_options(cfg/ImageInverter.cfg)
# ********************************************************************
# Add run time dependencies here
......@@ -82,7 +82,7 @@ include_directories(${catkin_INCLUDE_DIRS})
# add_library(${PROJECT_NAME} <list of source files>)
## Declare a cpp executable
add_executable(${PROJECT_NAME} src/image_modifier_alg.cpp src/image_modifier_alg_node.cpp)
add_executable(${PROJECT_NAME} src/image_inverter_alg.cpp src/image_inverter_alg_node.cpp)
# ********************************************************************
# Add the libraries
......
## Description
The iri_image_modifier project description
The iri_image_inverter project description
# ROS Interface
### Topic publishers
......@@ -38,7 +38,7 @@ catkin_make
- Standalone test
`roslaunch iri_image_modifier test.launch`
`roslaunch iri_image_inverter test.launch`
## Disclaimer
......
......@@ -31,7 +31,7 @@
# Author:
PACKAGE='iri_image_modifier'
PACKAGE='iri_image_inverter'
from dynamic_reconfigure.parameter_generator_catkin import *
......@@ -41,4 +41,4 @@ gen = ParameterGenerator()
gen.add("rate", double_t, 0, "Main loop rate (Hz)", 10.0, 0.1, 1000.0)
gen.add("invert", bool_t, 0, "Invert image colors", True)
exit(gen.generate(PACKAGE, "ImageModifierAlgorithm", "ImageModifier"))
exit(gen.generate(PACKAGE, "ImageInverterAlgorithm", "ImageInverter"))
......@@ -22,25 +22,25 @@
// refer to the IRI wiki page for more information:
// http://wikiri.upc.es/index.php/Robotics_Lab
#ifndef _image_modifier_alg_h_
#define _image_modifier_alg_h_
#ifndef _image_inverter_alg_h_
#define _image_inverter_alg_h_
#include <iri_image_modifier/ImageModifierConfig.h>
#include <iri_image_inverter/ImageInverterConfig.h>
//include image_modifier_alg main library
//include image_inverter_alg main library
/**
* \brief IRI ROS Specific Driver Class
*
*
*/
class ImageModifierAlgorithm
class ImageInverterAlgorithm
{
protected:
/**
* \brief define config type
*
* Define a Config type with the ImageModifierConfig. All driver implementations
* Define a Config type with the ImageInverterConfig. All driver implementations
* will then use the same variable type Config.
*/
pthread_mutex_t access_;
......@@ -51,10 +51,10 @@ class ImageModifierAlgorithm
/**
* \brief define config type
*
* Define a Config type with the ImageModifierConfig. All driver implementations
* Define a Config type with the ImageInverterConfig. All driver implementations
* will then use the same variable type Config.
*/
typedef iri_image_modifier::ImageModifierConfig Config;
typedef iri_image_inverter::ImageInverterConfig Config;
/**
* \brief config variable
......@@ -72,7 +72,7 @@ class ImageModifierAlgorithm
* Attributes from the main node driver class IriBaseDriver such as loop_rate,
* may be also overload here.
*/
ImageModifierAlgorithm(void);
ImageInverterAlgorithm(void);
/**
* \brief Lock Algorithm
......@@ -116,7 +116,7 @@ class ImageModifierAlgorithm
*/
void config_update(Config& config, uint32_t level=0);
// here define all image_modifier_alg interface methods to retrieve and set
// here define all image_inverter_alg interface methods to retrieve and set
// the driver parameters
/**
......@@ -125,7 +125,7 @@ class ImageModifierAlgorithm
* This destructor is called when the object is about to be destroyed.
*
*/
~ImageModifierAlgorithm(void);
~ImageInverterAlgorithm(void);
};
#endif
......@@ -22,11 +22,11 @@
// refer to the IRI wiki page for more information:
// http://wikiri.upc.es/index.php/Robotics_Lab
#ifndef _image_modifier_alg_node_h_
#define _image_modifier_alg_node_h_
#ifndef _image_inverter_alg_node_h_
#define _image_inverter_alg_node_h_
#include <iri_base_algorithm/iri_base_algorithm.h>
#include "image_modifier_alg.h"
#include "image_inverter_alg.h"
// [publisher subscriber headers]
#include <camera_info_manager/camera_info_manager.h>
......@@ -43,7 +43,7 @@
* \brief IRI ROS Specific Algorithm Class
*
*/
class ImageModifierAlgNode : public algorithm_base::IriBaseAlgorithm<ImageModifierAlgorithm>
class ImageInverterAlgNode : public algorithm_base::IriBaseAlgorithm<ImageInverterAlgorithm>
{
private:
// [publisher attributes]
......@@ -86,7 +86,7 @@ class ImageModifierAlgNode : public algorithm_base::IriBaseAlgorithm<ImageModifi
* This constructor initializes specific class attributes and all ROS
* communications variables to enable message exchange.
*/
ImageModifierAlgNode(void);
ImageInverterAlgNode(void);
/**
* \brief Destructor
......@@ -94,7 +94,7 @@ class ImageModifierAlgNode : public algorithm_base::IriBaseAlgorithm<ImageModifi
* This destructor frees all necessary dynamic memory allocated within this
* this class.
*/
~ImageModifierAlgNode(void);
~ImageInverterAlgNode(void);
protected:
/**
......
<?xml version="1.0" encoding="UTF-8"?>
<launch>
<arg name="node_name" default="iri_image_modifier"/>
<arg name="node_name" default="iri_image_inverter"/>
<arg name="output" default="screen"/>
<arg name="launch_prefix" default=""/>
<arg name="config_file" default="$(find iri_image_modifier)/config/params.yaml"/>
<arg name="config_file" default="$(find iri_image_inverter)/config/params.yaml"/>
<arg name="image_in_topic" default="image_in"/>
<arg name="image_out_topic" default="image_out"/>
<node name="$(arg node_name)"
pkg ="iri_image_modifier"
type="iri_image_modifier"
pkg ="iri_image_inverter"
type="iri_image_inverter"
output="$(arg output)"
launch-prefix="$(arg launch_prefix)">
<rosparam file="$(arg config_file)" command="load"/>
......
......@@ -5,17 +5,17 @@
<arg name="launch_prefix" default=""/>
<arg name="dr" default="true"/>
<include file="$(find iri_image_modifier)/launch/node.launch">
<arg name="node_name" value="iri_image_modifier"/>
<include file="$(find iri_image_inverter)/launch/node.launch">
<arg name="node_name" value="iri_image_inverter"/>
<arg name="output" value="$(arg output)"/>
<arg name="launch_prefix" value="$(arg launch_prefix)"/>
</include>
<node name="rqt_reconfigure_iri_image_modifier"
<node name="rqt_reconfigure_iri_image_inverter"
pkg ="rqt_reconfigure"
type="rqt_reconfigure"
if ="$(arg dr)"
args="iri_image_modifier">
args="iri_image_inverter">
</node>
</launch>
\ No newline at end of file
</launch>
<?xml version="1.0"?>
<package format="2">
<name>iri_image_modifier</name>
<name>iri_image_inverter</name>
<version>1.0.0</version>
<description>The iri_image_modifier package subscribe to an image and republishes it with chosen modifications made on it</description>
<description>The iri_image_inverter package subscribe to an image and republishes it with chosen modifications made on it</description>
<!-- One maintainer tag required, multiple allowed, one person per tag -->
<!-- Example: -->
......@@ -19,7 +19,7 @@
<!-- Url tags are optional, but multiple are allowed, one per tag -->
<!-- Optional attribute type can be: website, bugtracker, or repository -->
<!-- Example: -->
<!-- <url type="website">http://wiki.ros.org/iri_image_modifier</url> -->
<!-- <url type="website">http://wiki.ros.org/iri_image_inverter</url> -->
<!-- Author tags are optional, multiple are allowed, one per tag -->
......
#include "image_modifier_alg.h"
#include "image_inverter_alg.h"
ImageModifierAlgorithm::ImageModifierAlgorithm(void)
ImageInverterAlgorithm::ImageInverterAlgorithm(void)
{
pthread_mutex_init(&this->access_,NULL);
}
ImageModifierAlgorithm::~ImageModifierAlgorithm(void)
ImageInverterAlgorithm::~ImageInverterAlgorithm(void)
{
pthread_mutex_destroy(&this->access_);
}
void ImageModifierAlgorithm::config_update(Config& config, uint32_t level)
void ImageInverterAlgorithm::config_update(Config& config, uint32_t level)
{
this->lock();
......@@ -20,4 +20,4 @@ void ImageModifierAlgorithm::config_update(Config& config, uint32_t level)
this->unlock();
}
// ImageModifierAlgorithm Public API
// ImageInverterAlgorithm Public API
#include "image_modifier_alg_node.h"
#include "image_inverter_alg_node.h"
ImageModifierAlgNode::ImageModifierAlgNode(void) :
algorithm_base::IriBaseAlgorithm<ImageModifierAlgorithm>(),
ImageInverterAlgNode::ImageInverterAlgNode(void) :
algorithm_base::IriBaseAlgorithm<ImageInverterAlgorithm>(),
image_camera_manager(ros::NodeHandle("~image")),
it(this->private_node_handle_)
{
//init class attributes if necessary
if(!this->private_node_handle_.getParam("rate", this->config_.rate))
{
ROS_WARN("ImageModifierAlgNode::ImageModifierAlgNode: param 'rate' not found");
ROS_WARN("ImageInverterAlgNode::ImageInverterAlgNode: param 'rate' not found");
}
else
this->setRate(this->config_.rate);
......@@ -29,7 +29,7 @@ ImageModifierAlgNode::ImageModifierAlgNode(void) :
// [init subscribers]
this->image_subscriber_ = this->it.subscribeCamera("image_in/image_raw", 1, &ImageModifierAlgNode::image_callback, this);
this->image_subscriber_ = this->it.subscribeCamera("image_in/image_raw", 1, &ImageInverterAlgNode::image_callback, this);
pthread_mutex_init(&this->image_mutex_,NULL);
......@@ -42,17 +42,17 @@ ImageModifierAlgNode::ImageModifierAlgNode(void) :
// [init action clients]
}
ImageModifierAlgNode::~ImageModifierAlgNode(void)
ImageInverterAlgNode::~ImageInverterAlgNode(void)
{
// [free dynamic memory]
pthread_mutex_destroy(&this->image_mutex_);
}
void ImageModifierAlgNode::mainNodeThread(void)
void ImageInverterAlgNode::mainNodeThread(void)
{
//lock access to algorithm if necessary
this->alg_.lock();
ROS_DEBUG("ImageModifierAlgNode::mainNodeThread");
ROS_DEBUG("ImageInverterAlgNode::mainNodeThread");
// [fill msg structures]
// Initialize the topic message structure
//this->image_Image_msg_.data = my_var;
......@@ -78,9 +78,9 @@ void ImageModifierAlgNode::mainNodeThread(void)
}
/* [subscriber callbacks] */
void ImageModifierAlgNode::image_callback(const sensor_msgs::Image::ConstPtr& msg, const sensor_msgs::CameraInfoConstPtr& info)
void ImageInverterAlgNode::image_callback(const sensor_msgs::Image::ConstPtr& msg, const sensor_msgs::CameraInfoConstPtr& info)
{
//ROS_INFO("ImageModifierAlgNode::image_callback: New Message Received");
//ROS_INFO("ImageInverterAlgNode::image_callback: New Message Received");
//use appropiate mutex to shared variables if necessary
//this->alg_.lock();
......@@ -101,12 +101,12 @@ void ImageModifierAlgNode::image_callback(const sensor_msgs::Image::ConstPtr& ms
//this->image_mutex_exit();
}
void ImageModifierAlgNode::image_mutex_enter(void)
void ImageInverterAlgNode::image_mutex_enter(void)
{
pthread_mutex_lock(&this->image_mutex_);
}
void ImageModifierAlgNode::image_mutex_exit(void)
void ImageInverterAlgNode::image_mutex_exit(void)
{
pthread_mutex_unlock(&this->image_mutex_);
}
......@@ -118,7 +118,7 @@ void ImageModifierAlgNode::image_mutex_exit(void)
/* [action requests] */
void ImageModifierAlgNode::node_config_update(Config &config, uint32_t level)
void ImageInverterAlgNode::node_config_update(Config &config, uint32_t level)
{
this->alg_.lock();
if(config.rate!=this->getRate())
......@@ -127,12 +127,12 @@ void ImageModifierAlgNode::node_config_update(Config &config, uint32_t level)
this->alg_.unlock();
}
void ImageModifierAlgNode::addNodeDiagnostics(void)
void ImageInverterAlgNode::addNodeDiagnostics(void)
{
}
/* main function */
int main(int argc,char *argv[])
{
return algorithm_base::main<ImageModifierAlgNode>(argc, argv, "image_modifier_alg_node");
return algorithm_base::main<ImageInverterAlgNode>(argc, argv, "image_inverter_alg_node");
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment