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

mpkuse's profile - activity

2019-02-12 02:58:18 -0500 received badge  Famous Question (source)
2019-02-12 02:58:18 -0500 received badge  Notable Question (source)
2016-06-21 14:08:22 -0500 received badge  Notable Question (source)
2016-06-21 14:08:22 -0500 received badge  Famous Question (source)
2016-04-30 02:33:36 -0500 received badge  Popular Question (source)
2016-04-02 05:48:40 -0500 received badge  Famous Question (source)
2016-02-13 09:33:31 -0500 received badge  Famous Question (source)
2015-12-10 04:35:28 -0500 received badge  Popular Question (source)
2015-12-10 04:35:28 -0500 received badge  Notable Question (source)
2015-08-18 07:36:22 -0500 received badge  Popular Question (source)
2015-08-17 05:21:25 -0500 asked a question Multiple display with RViz

Is there a way with Rviz to have multiple view point display at the same time. Something like the 4 views available in Maya. Some thing like : http://community.digitalmediaacademy....

2015-08-05 03:37:07 -0500 commented answer Creating an RVIZ plugin for a new display type

Another year passed. Seems like there is no relief for plugin makers. I guess now they have these random tutorials but cannot seem to get the configuration correctly with catkin. The tutorials use ros_make. Anyone with experience???

2015-04-30 23:23:34 -0500 received badge  Notable Question (source)
2015-04-14 14:46:44 -0500 received badge  Popular Question (source)
2015-04-13 23:22:52 -0500 received badge  Supporter (source)
2015-04-13 23:22:39 -0500 received badge  Scholar (source)
2015-04-13 15:44:55 -0500 received badge  Student (source)
2015-04-12 10:43:54 -0500 asked a question Marker display points Overwrite

I would like to display Marker points with rviz. However I wish to have the points overwrite (persistent) in every iteration and not plot new points in each iteration.

I am plotting a set of 50 points per iteration. I want the points to accumulate, ie. at 2nd iteration I have 100 points on display on 3rd iteration 150 points and so on.

I noticed the documentation link:rviz/DisplayType/Marker have a parameter lifetime. I tried setting it to zero as in the code but still cannot get that effect. How can I achieve it?

#include <ros/ros.h>

#include <visualization_msgs/Marker.h>
#include <geometry_msgs/Point.h>



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

    ros::init(argc, argv, "viz3d");
    ros::NodeHandle nh;


    ros::Publisher pub = nh.advertise<visualization_msgs::Marker>("viz_marker", 100 );
    ros::Rate rate(2);

    cv::Mat frame, dframe;

    ros::Time stamp = ros::Time::now();
    while( ros::ok() )
    {
        ROS_INFO_STREAM( "Publishing point " );

        visualization_msgs::Marker msg;
        msg.header.frame_id = "/my_frame";
        msg.header.stamp = stamp;
        msg.ns = "xuv";
        msg.id = 0;
        msg.action = visualization_msgs::Marker::ADD;
        ros::Duration du(0.0);
        msg.lifetime = du;

        msg.type = visualization_msgs::Marker::POINTS;


        msg.scale.x = 0.02;
        msg.scale.y = 0.02;


        for( int i=0; i<50 ; i++)
        {
            geometry_msgs::Point pt;
            pt.x = drand48();
            pt.y = 10*drand48();
            pt.z = drand48();

            std_msgs::ColorRGBA col;
            col.r = 1.0;
            col.g = 0.0;
            col.b = 0.0;
            col.a = 1.0;
            msg.colors.push_back(col);

            msg.points.push_back(pt);

        }


        msg.color.r = 0.0;
        msg.color.g = 0.0;
        msg.color.b = 0.0;
        msg.color.a = 1.0;

        pub.publish(msg);
        rate.sleep();

    }


}
2015-04-12 10:43:53 -0500 asked a question Custom message with sensor_msgs/Image

I have a custom .msg file MyImage.msg

sensor_msgs/Image im
float32 age
string name

I have configured the custom .msg fle as illustrated in link:CreatingMsgAndSrv

Further, I am trying to write a simple publisher with this msg.

#include <ros/ros.h>

#include <custom_msg/MyImage.h>
#include <image_transport/image_transport.h>


#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include <cv_bridge/cv_bridge.h>



int main( int argc, char ** argv )
{
    ros::init(argc, argv, "publish_custom");
    ros::NodeHandle nh;

    ros::Publisher pub2 = nh.advertise<custom_msg::MyImage>("custom_image", 2 );

    cv::Mat image = cv::imread( "Lenna.png", CV_LOAD_IMAGE_COLOR );
    sensor_msgs::ImagePtr im_msg = cv_bridge::CvImage(std_msgs::Header(), "bgr8", image).toImageMsg();

    ros::Rate rate( 2 );

    while( ros::ok() )
    {
        ROS_INFO_STREAM_ONCE( "IN main loop");


        custom_msg::MyImage msg2;
        msg2.age=54.3;
        msg2.im = im_msg;
        msg2.name="Gena";

        pub2.publish(msg2);

        rate.sleep();
    }
}

This does not seem to compile with catkin_make. The error messages are -

/home/eeuser/ros_workspaces/HeloRosProject/src/custom_msg/publish.cpp: In function ‘int main(int, char**)’:
/home/eeuser/ros_workspaces/HeloRosProject/src/custom_msg/publish.cpp:40:19: error: no match for ‘operator=’ in ‘msg2.custom_msg::MyImage_<std::allocator<void> >::im = im_msg’
/home/eeuser/ros_workspaces/HeloRosProject/src/custom_msg/publish.cpp:40:19: note: candidate is:
/opt/ros/hydro/include/sensor_msgs/Image.h:56:8: note: sensor_msgs::Image_<std::allocator<void> >& sensor_msgs::Image_<std::allocator<void> >::operator=(const sensor_msgs::Image_<std::allocator<void> >&)
/opt/ros/hydro/include/sensor_msgs/Image.h:56:8: note:   no known conversion for argument 1 from ‘sensor_msgs::ImagePtr {aka boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > >}’ to ‘const sensor_msgs::Image_<std::allocator<void> >&’
make[2]: *** [custom_msg/CMakeFiles/publish.dir/publish.cpp.o] Error 1
make[1]: *** [custom_msg/CMakeFiles/publish.dir/all] Error 2
make: *** [all] Error 2
Invoking "make" failed

I can understand that msg2.im = im_msg; isn't correct. Please help me fix this.

2015-04-12 10:43:53 -0500 asked a question ROS with Qt creator. New packages do not show up

I am fairly new to ROS. I started using QtCreator as my IDE for ROS development. I followed the instructions from http://wiki.ros.org/IDEs#QtCreator .

My problem is that whenever I add a new package using catkin_create_pkg the newly added package do not show up in QtCreator. I also tried reloading CMakeList.txt file from QtCreator (the one at workspace level).

What am I doing wrongly.