ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

turtle's profile - activity

2019-07-22 11:34:44 -0500 received badge  Taxonomist
2015-03-10 13:49:07 -0500 received badge  Famous Question (source)
2015-01-25 21:29:37 -0500 received badge  Famous Question (source)
2014-12-29 13:43:02 -0500 received badge  Famous Question (source)
2014-11-29 14:12:49 -0500 received badge  Famous Question (source)
2014-09-22 05:56:15 -0500 commented answer how to publish and sub camera in opencv

thank you ! how to subscribe !

2014-09-22 05:47:43 -0500 received badge  Enthusiast
2014-09-21 03:46:18 -0500 received badge  Editor (source)
2014-09-21 03:45:07 -0500 received badge  Notable Question (source)
2014-09-18 22:49:37 -0500 commented answer how to publish and sub camera in opencv

I do not know how to use it . can you repeat clearly ?

2014-09-18 14:52:53 -0500 received badge  Student (source)
2014-09-18 14:42:01 -0500 received badge  Popular Question (source)
2014-09-18 08:36:32 -0500 asked a question how to publish and sub camera in opencv

i've finished my opencv program ! I want to publish to pc other (LAN) What should I do

Here my program opencv

/*
 * roscolor.cpp
 *
 *  Created on: Sep 5, 2014
 *      Author: dell
 */
#include <ros/ros.h>
#include <vector>
#include <stdio.h>
#include <math.h>
#include <image_transport/image_transport.h>
#include <cv_bridge/cv_bridge.h>
#include <sensor_msgs/image_encodings.h>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <sensor_msgs/Image.h>
#include <opencv2/opencv.hpp>
using namespace cv;
int minR = 0;
int minG = 0;
int minB = 0;
int maxR = 255;
int maxG = 255;
int maxB = 255;
void imageCallback(const sensor_msgs::ImageConstPtr& color_img)
{
    cv_bridge::CvImagePtr img_ptr;
    cv::Mat img_rgb;
    try
    {
        img_ptr = cv_bridge::toCvCopy(color_img,
        sensor_msgs::image_encodings::BGR8);
        img_rgb = img_ptr->image;
    }
    catch (cv_bridge::Exception& e)
    {
        ROS_ERROR("cv_bridge exception: \%s", e.what());
        return;
    }
    cvCreateTrackbar("min R:","trackbar",&minR, 255);
    cvCreateTrackbar("min G:","trackbar",&minG, 255);
    cvCreateTrackbar("min B:","trackbar",&minB, 255);
    cvCreateTrackbar("max R:","trackbar",&maxR, 255);
    cvCreateTrackbar("max G:","trackbar",&maxG, 255);
    cvCreateTrackbar("max B:","trackbar",&maxB, 255);
    //cv::Mat img_hsv;
    cv::Mat img_binary;
    CvMoments colorMoment;
    cv::Scalar min_vals(minR, minG, minB);
    cv::Scalar max_vals(maxR, maxG, maxB);
    //cv::cvtColor(img_rgb, img_hsv, CV_BGR2HSV);
    cv::inRange(img_rgb, min_vals, max_vals, img_binary);
    dilate( img_binary, img_binary, getStructuringElement(MORPH_ELLIPSE, Size(10, 10)) );
    /*======================= TOA DO ================================*/
    colorMoment = moments(img_binary);
    double moment10 = cvGetSpatialMoment(&colorMoment, 1, 0);
    double moment01 = cvGetSpatialMoment(&colorMoment, 0, 1);
    double area = cvGetCentralMoment(&colorMoment, 0, 0);
    float posX = (moment10/area);
    float posY = (moment01/area);
    /*================= HIEN THI =================================*/
    printf("1. x-Axis  %f  y-Axis  %f  Area  %f\n", moment10, moment01, area);
    printf("2. x  %f  y %f \n\n", posX , posY);

    cv::imshow("TRACKING COLOR", img_binary);
    cv::imshow("RGB image", img_rgb);
    cv::waitKey(3);

}
int main(int argc, char **argv)
{
    ros::init(argc, argv, "HSV_image");
    ros::NodeHandle nh;
    cvNamedWindow("TRACKING COLOR", 2 );
    cvNamedWindow("RGB image", 2 );
    cvNamedWindow ("trackbar", 2 );
    cvStartWindowThread();
    image_transport::ImageTransport it(nh);
    ros::Subscriber cam_img_sub =nh.subscribe("/gscam/image_raw", 1, &imageCallback);
    ros::spin();
    cvDestroyWindow("TRACKING COLOR");
    cvDestroyWindow("RGB image");
}

can you help me, please ? Thank you!

2014-09-18 07:42:02 -0500 received badge  Notable Question (source)
2014-09-18 04:55:37 -0500 received badge  Popular Question (source)
2014-09-17 11:20:14 -0500 received badge  Organizer (source)
2014-09-17 11:19:31 -0500 asked a question how to publisher image and camera

I don't know publisher image and camera Can you help me ? I use ros fuerte . I want to publisher camera but i don't now !

2014-09-13 23:33:12 -0500 received badge  Notable Question (source)
2014-09-12 04:42:48 -0500 received badge  Popular Question (source)
2014-09-12 04:39:02 -0500 received badge  Supporter (source)
2014-09-12 04:37:54 -0500 commented answer how to publish int8,float ...and function ?

Thanhk you ! i done

2014-09-12 02:13:01 -0500 asked a question how to publish int8,float ...and function ?

i can't publish int8 .. can you help me?

  #include "ros/ros.h"
#include "std_msgs/Int8.h"

#include <sstream>


int main(int argc, char **argv)
{

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

  ros::NodeHandle n;


  ros::Publisher chatter_pub = n.advertise<std_msgs::Int8>("mytopic", 1000);

  ros::Rate loop_rate(10);

    int8_t count = 0;
  while (ros::ok())
  {

    std_msgs::Int8 msg;


    msg.data = count++;

    ROS_INFO("%s", msg.data);


    chatter_pub.publish(msg);

    ros::spinOnce();

    loop_rate.sleep();

  }


  return 0;
}

display : NULL

2014-09-12 02:05:13 -0500 commented answer publish up wifi

thank you.. i done ! @@

2014-09-10 09:07:39 -0500 received badge  Notable Question (source)
2014-09-09 10:33:58 -0500 marked best answer publish up wifi

i can't puplish mesage up wifi .. can you help me ? sorry I don't speak English well. thank you

2014-09-09 10:33:57 -0500 commented answer publish up wifi

Can you repeat clearly,please

2014-09-09 10:05:04 -0500 received badge  Popular Question (source)
2014-09-09 09:42:28 -0500 commented question publish up wifi

thank you i just can publish mesage in my pc i can't publish to other pc in LAN

2014-09-09 09:38:36 -0500 received badge  Scholar (source)
2014-09-09 09:38:28 -0500 commented answer publish up wifi

thank you , i'll try