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

ebbeowulf's profile - activity

2018-02-22 13:43:42 -0500 received badge  Famous Question (source)
2017-09-19 14:20:08 -0500 received badge  Notable Question (source)
2017-09-19 14:20:08 -0500 received badge  Popular Question (source)
2017-04-05 17:18:09 -0500 received badge  Student (source)
2017-04-05 17:10:00 -0500 commented question call custom service in python

Type and size:

>>> x_data.dtype
dtype('uint8')

>>> x_data.shape
(1357200,)
2017-04-05 15:27:46 -0500 commented question call custom service in python

x_data is the output of img.flatten(), so it should be a 1D numpy array.

2017-04-04 12:43:58 -0500 asked a question call custom service in python

I am using Indigo, and having trouble calling a service from python.

I have defined a service for sending images and receiving a message:

#***** perception_core::FR.srv ******
# image size
int16 rows
int16 cols
int16 step
# copy of Mat data structure
int8[] image_data
---
int8[] bbox
float likelihood

The server side operation is implemented in C++, and works just fine. I use it regularly with other C++ programs. However, when calling it from python I am struggling:

from perception_core.srv import FR
rospy.wait_for_service('/ros_matching/FR_srv')
FR_srv = rospy.ServiceProxy('/ros_matching/FR_srv', FR)
img_in = imread('...')
img = np.array(img_in)
x_data = img.flatten()
bbox,likelihood = FR_srv(img.shape[0],img.shape[1],img.shape[1],x_data.tolist())

And I get the following error: * SerializationError: field image_data[] exceeds specified width [int8]

I've also tried initializing the array beforehand:

request = FR()
request.rows = img.shape[0]
request.cols = img.shape[1]
request.step = img.shape[1]
request.image_data = x_data.tolist()
bbox,likelihood = FR_srv(request)

But this generates a different error:

* TypeError: Invalid number of arguments, args should be ['rows', 'cols', 'step', 'image_data'] args are(<perception_core.srv._fr.fr object="" at="" 0x7f24681ffd50="">,)

Any thoughts or suggestions on what to try next would be greatly appreciated.

2015-11-27 16:32:59 -0500 received badge  Taxonomist
2013-07-22 02:12:14 -0500 received badge  Famous Question (source)
2013-04-13 01:42:16 -0500 received badge  Famous Question (source)
2013-04-03 01:01:53 -0500 received badge  Notable Question (source)
2013-02-15 06:56:53 -0500 received badge  Popular Question (source)
2013-02-10 16:32:09 -0500 received badge  Notable Question (source)
2013-02-08 01:17:02 -0500 received badge  Popular Question (source)
2013-02-07 12:00:58 -0500 asked a question roscore reduce network bandwidth

I just got warned about overloading my local network if I placed a bandwidth heavy sensor on one machine and the roscore on a different computer. What I don't understand is exactly how roscore coordinates data transfer.

For example, the roscore node is on machine A, and the sensor is on machine B. If all of the processes that need access to the data rich sensor remain on machine B, will that still require heavy network bandwidth? In other words, does all data get passed through the roscore on machine A, thereby overloading the network? or does it actually coordinate direct tcp sockets between processes so that I could intelligently separate my processes to prevent network overload?

Thank You!

2013-02-07 11:54:11 -0500 received badge  Scholar (source)
2013-02-07 09:30:56 -0500 received badge  Editor (source)
2013-02-07 09:25:29 -0500 asked a question IPC between 64-bit and 32-bit installations

I have two different packages that I need to run in ROS (fuerte), but one works correctly in the 32-bit installation, while the other works only in the 64-bit installation. I do not have the skill set to force either package into the opposing version of ROS.

So, can I run two computers, one with a 32-bit installation and the other with 64-bit, and communicate between them normally? In other words, can I set up a standard roscore on one machine and have the other simply feed data to it?

I've been trying to test this with simulated data, and gotten some errors - but I'm not sure if it was because the difference in 32 vs 64 bit, or because I made some other mistake. And, unfortunately, I need to answer this question before buying the sensor, so I can't test it in hardware yet.

Thank you in advance