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

Brijendra Singh's profile - activity

2016-05-25 05:16:25 -0500 received badge  Nice Question (source)
2014-08-26 11:47:06 -0500 received badge  Famous Question (source)
2014-06-29 04:32:24 -0500 received badge  Taxonomist
2014-06-12 10:24:05 -0500 received badge  Notable Question (source)
2014-05-04 19:46:42 -0500 received badge  Enthusiast
2014-05-04 17:51:20 -0500 received badge  Popular Question (source)
2014-04-29 20:17:49 -0500 received badge  Supporter (source)
2014-04-29 20:17:17 -0500 commented answer Display ros image on webpage using roslibjs

Thanks a lot man. I was not aware of this package. After installing the package it is working awesome.

2014-04-29 19:49:09 -0500 received badge  Scholar (source)
2014-04-28 19:18:41 -0500 asked a question Display ros image on webpage using roslibjs

Hi all,
Problem:
I am using ros hydro and publishing compressed image on a topic /cameraColor. Also, I am using rosjslib(webpage) to interact with rosbridge_server. Now I want to display image on webpage subscribing to topic mentioned.
Action done by me: I have used python opencv to save image from that topic in a jpeg file (open cv has method to save image in any format)and then trying to open file and encode it into base64 string . Now I am publishing this base64 string in a seperate topic /base64Image. After subscribing this /base64Image I am able to display image on webpage. But this is a workaround and I am not satisfied with solution. Please suggest me some way to display image on webpage by subscribing to some topic without saving image in jpeg format. Some way to convert ros image in a base64 format directly will be better. I am posting my code for both python code at server side and javascript code in webpage.
Also, please suggest some way to display video from ros on webpage using rosjslib.
Any help will be appreciated.

Thank you.
My code: Python code to convert ros image into base64 and publishig
def __init__(self):
self.image_pub = rospy.Publisher("image_topic_2",Image)
self.imagePub = rospy.Publisher("imageJpeg",String)
print "1"
#cv.NamedWindow("Image window", 1)
self.bridge = CvBridge()
self.image_sub = rospy.Subscriber("/usb_cam/image_raw",Image,self.callback)#/camera/rgb/image_color
self.counter = 0
def callback(self,data):
#print "2"
try:
   cv_image = self.bridge.imgmsg_to_cv(data, "bgr8")
 #self.imagePub.publish(cv_image)
 fileName = "foo_"+str(strftime("%H:%M:%S", gmtime()))
 cv.SaveImage("images/"+fileName+".jpg", cv_image)#"+str(strftime("%H:%M:%S", gmtime()))+"
 image_64 = base64.encodestring(open("images/"+fileName+".jpg","rb").read())
 self.imagePub.publish(str(image_64))
 #cv.WaitKey(2)
 #time.sleep(2)
except CvBridgeError, e:
 print e

Javascript code on webpage using rosjslib
//Subscribing Images on Capture image click
imageRos.subscribe(function(message) {
 if(imageFlag === true){
// console.log(message.data);
 console.log("hello");
// var encoded = btoa (unescape(encodeURIComponent(message.data)));
  var ImageData1="data:image/jpeg;base64,"+message.data;

// ImageData1 = "data:image/jpeg;base64,"+ ImageData1;
  displayImage = document.getElementById("topImage1img1");
  displayImage.setAttribute('src', ImageData1);
 imageFlag = false;
// console.log("imageclicked:"+ImageData1);

}

});

2014-04-23 22:41:18 -0500 received badge  Famous Question (source)
2014-04-20 06:56:26 -0500 marked best answer How to configure the correct laser scan height in ROS Hydro for turtlebot?

I'm trying to adjust the laser scan height of kinect in ROS Hydro. The default configuration is for the kobuki base, however I'm using the turtlebot with create base. What should be the scan height for turtlebot?

The parameter is param name="scan_height" value="10" in 3dsensor.launch file.

Please let me know the correct parameter value for scan_height to work with turtlebot.

2014-03-23 20:36:22 -0500 answered a question Kinect "no device connected" error in openni.launch after openni-dev package upgrade

I resolved the issue by un-installing the openni-dev package, which also removed the dependencies - nite-dev, ps-engine, ros-electric-turtlebot, ros-electric-turtlebot-desktop, ros-electric-turtlebot-robot, ros-electric-turtlebot-viz, ros-electric-openni-kinect. And then re-installing these packages.

The openni.launch process is working fine now.

2014-03-23 20:30:28 -0500 received badge  Notable Question (source)
2014-03-12 19:20:23 -0500 received badge  Popular Question (source)
2014-03-12 01:03:58 -0500 received badge  Organizer (source)
2014-03-12 01:02:54 -0500 asked a question Kinect "no device connected" error in openni.launch after openni-dev package upgrade

Hi,

I'm using turtlebot on ROS electric on ubuntu 11.04.

The openni-dev package was recently updated from version 1.1.0.41~natty to 1.3.2.1-4~natty2. After this update, the openni.launch process gives the error "No device connected.. Waiting for devices to be connected". Its not able to initialize.

I tried to downgrade the openni-dev version using the command: "sudo apt-get install openni-dev=1.1.0.41~natty", but it says that the version was not found. I have also tried replacing the entries in the source.list files for apt to "old-releases.ubuntu.com", but it still didn't work.

Any help would be appreciated.

Thanks.

2014-03-02 23:13:15 -0500 received badge  Famous Question (source)
2014-01-18 02:54:55 -0500 received badge  Famous Question (source)
2013-12-19 21:35:39 -0500 received badge  Famous Question (source)
2013-12-19 17:45:36 -0500 received badge  Notable Question (source)
2013-12-18 21:43:18 -0500 received badge  Famous Question (source)
2013-12-18 21:40:10 -0500 commented answer How to configure the correct laser scan height in ROS Hydro for turtlebot?

As far as i know, kobuki is default robot with ROS Hydro, hence it may be the case that height of the kinect in kobuki and create base is different.

2013-12-18 21:39:51 -0500 commented answer How to configure the correct laser scan height in ROS Hydro for turtlebot?

When we are using the default parameters for gmapping in turtlebot_navigation stack(Hydro) , its scans are not properly detecting the obstacles, but in case of Ros electric, laserscans are properly aligned with the obstacles.In both the cases we are using default parameters.