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

IvanShindev's profile - activity

2015-01-05 15:29:33 -0500 received badge  Nice Answer (source)
2014-07-21 12:17:33 -0500 received badge  Necromancer (source)
2013-01-23 21:36:51 -0500 received badge  Good Answer (source)
2012-12-12 03:21:02 -0500 received badge  Nice Answer (source)
2012-12-07 22:16:56 -0500 received badge  Teacher (source)
2012-12-07 22:16:56 -0500 received badge  Necromancer (source)
2012-11-11 12:57:32 -0500 answered a question nodelet doesn't start

This post may be outdated but I had the same problem recently. Make sure that in your manifest.xml file you have <depend package="nodelet"/>. Run "rospack plugins --attrib=plugin nodelet" and make sure your plugin is showing. Your plugin should show even if the package is not made, as long as you export it in the manifest.xml file and have the nodelet packete declared as a dependency.

2012-04-25 05:36:37 -0500 answered a question Subscribing 2 topics of different types in a callback function

I believe the best way to do this is to use the boost::shared_ptr<synchronizer>. For example the openni node uses this to synchronize a depth_msg and rgb_msg and pass them as arguments to callback a function. The following code is from the openni_nodelet.cpp:

boost::shared_ptr<synchronizer> depth_rgb_sync_; //from header file

SyncPolicy sync_policy (4); // queue size

depth_rgb_sync_.reset (new Synchronizer (sync_policy));

depth_rgb_sync_->registerCallback (boost::bind (&OpenNINodelet::publishXYZRGBPointCloud, this, _1, _2));

depth_rgb_sync_->add < 1 > (rgb_msg);

depth_rgb_sync_->add < 0 > (depth_msg);

and the callback function is:

void OpenNINodelet::publishXYZRGBPointCloud (const sensor_msgs::ImageConstPtr& depth_msg, const sensor_msgs::ImageConstPtr& rgb_msg) const {}

So you can subscribe to 2 different topics, each having their own message, and in their callback functions you can add the msg to the boost synchronizer. For example in the first callback you can do depth_rgb_sync_->add < 1 > (rgb_msg) and in the second one depth_rgb_sync_->add < 0 > (depth_msg) where depth_rgb_sync_ will be replaced by your boost::shared_ptr<synchronizer> and rgb_msg and depth_msg will be replaced by the messages of the 2 topics. When both messages are received the boost synchronizer will call your function with the 2 msgs as arguments.

Hope this help. Ivan

2012-04-04 03:10:49 -0500 answered a question kinect in Ubuntu-VMware workstation question

Even if you can make the VM to connect to the Kinect, you still might not get data from it because the connection protocol is too slow. What I have is PCL-Win32 on Windows 7 and it includes the ros-sdk-electric for windows (Boost 1.44 because it is needed for the ros-sdk). I then use the PCL_IO to connect to the kinect, convert the data into PointCloud2 and I publish it. When you publish topics using the ros-win you have to setup the Linux machine as a master. I can get the published PointCloud2 data on the VM or on any Linux running machine. You can use the PointCloud2 as it is or convert it to sensor_msgs::Image or a different type of data depending on your application. As a side note, I installed the PCL from source (not the prebuild one) and replaced the sensor_msgs (PCL/trunk/common/include/sensor_msgs) with the sensor_msgs header files from my linux machine (opt/ros/electric/stacks/common_msgs/sensor_msgs/msg_gen/cpp/include/sensor_msgs). You only need to build pcl_common and pcl_io in order to connect to the kinect. You can use the pcl_openni_io example to see how to callback on XYZRGB Point and use the /pcl/ros/conversions.h to see how to convert that to PointCloud2. Do not use the toROSmsg() function provided by the pcl but copy the function directly in your code. The publishing rate is pretty high, I tested my code between 2 laptops (one windows one linux os) and it still had decent publishing rate, the rate is even higher if you use a windows host and a linux guest on a VM.

It might seem like a lot of work but having PCL with ROS running on Windows is pretty awesome, especially if you are running a VM. You can reduce the CPU load from the VM by running some code on Windows.

2012-04-04 03:09:55 -0500 answered a question kinect in Ubuntu-VMware workstation question

Even if you can make the VM to connect to the Kinect, you still might not get data from it because the connection protocol is too slow. What I have is PCL-Win32 on Windows 7 and it includes the ros-sdk-electric for windows (Boost 1.44 because it is needed for the ros-sdk). I then use the PCL_IO to connect to the kinect, convert the data into PointCloud2 and I publish it. When you publish topics using the ros-win you have to setup the Linux machine as a master. I can get the published PointCloud2 data on the VM or on any Linux running machine. You can use the PointCloud2 as it is or convert it to sensor_msgs::Image or a different type of data depending on your application. As a side note, I installed the PCL from source (not the prebuild one) and replaced the sensor_msgs (PCL/trunk/common/include/sensor_msgs) with the sensor_msgs header files from my linux machine (opt/ros/electric/stacks/common_msgs/sensor_msgs/msg_gen/cpp/include/sensor_msgs). You only need to build pcl_common and pcl_io in order to connect to the kinect. You can use the pcl_openni_io example to see how to callback on XYZRGB Point and use the /pcl/ros/conversions.h to see how to convert that to PointCloud2. Do not use the toROSmsg() function provided by the pcl but copy the function directly in your code. The publishing rate is pretty high, I tested my code between 2 laptops (one windows one linux os) and it still had decent publishing rate, the rate is even higher if you use a windows host and a linux guest on a VM.

It might seem like a lot of work but having PCL with ROS running on Windows is pretty awesome, especially if you are running a VM. You can reduce the CPU load from the VM by running some code on Windows.

Hope this helps, Ivan