Tag Archives: ROS

Converting sensor_msgs::PCLPointCloud2 to sensor_msgs::PointCloud and reverse

 

Converting pcl::PCLPointCloud2 to pcl::PointCloud and reverse

 

 

more about pcl point cloud and conversion

Control your robot with a joystick in ROS

In other tutorials, I showed how to get access to the joystick and how to code with that. In this tutorial, I’m  gonna show you how to do that without writing any line of code.

First, install the required packages:

Now call the following

 

This will publish the topic “/joy_node” which is type of “sensor_msgs/Joy

Now you need to create your favorite message from that, for instance, if you want to move your robot you need to create “Twist” and publish that over /cmd_vel. To do that, create a yaml file and call it “joystick_param.yaml”, then put the following in the file and save it:

 

 

 

 

Now load it to ROS param:

Then you can call joy_teleop.py, so it will check the values that you set into teleop and publish 

/chatter and /cmd_vel

Alternatively, you can just call the following which will do lines above at once:

 

read more:

joy, joy_teleop, teleop_twist_joy, teleop_example

Controlling your robot with joystick and reading data from it

First, install the necessary package:

make sure your joystick is working:

also, make sure your controller has correct permissions:

The permission on the last column must be rw, if it “–” like this:

then correct the permission:

run the Joy node and roscore:

The joystick data are being published under /joy topic. To see the data:

to use the joystick  in your code follow this guideline:

full code at my Github.

How to use a calibrated camera in ROS

In my previous tutorial I showed you how to calibrate a camera with ROS. In this tutorial, I’m gonna show you how to rectify the images from coming from your camera.

First, open your text editor and paste the following text into it:

make the necessary changes and save it under usb_cam_stream_publisher.launch

Now run it:

Open another text document and paste the following into it:

save it under image_proc.launch. Now run it:

The codes are available on my Github

 

Real-time object recognition and 6DOF pose estimation based on Linemod algorithm with ROS and PCL pointcloud

In this tutorial, I’m gonna show you how to do object recognition and 6DOF pose estimation in real-time based on Linemod algorithm with ROS and PCL pointcloud. First, you need to install ork:

Then add the model of your object for tracking to Couch DB:

You need to install Kinect driver, if you don’t know how, follow my tutorial about that.

And select /camera/driver from the drop-down menu. Enable the depth_registration checkbox. Now go back to RViz, and change your PointCloud2 topic to /camera/depth_registered/points.