Streaming ports in a service to ROS

I have an Orocos component called MyComponent that provides a service called MyService. I have added a port on that service called MyPort. When I deploy MyComponent, I can get a Lua variable that points to that service thusly:

> depl:loadComponent("MyComponent", "MyComponent")
> myComponent= depl:getPeer("MyComponent")
> myService = myComponent:provides("MyService")

I can successfully get a Lua variable that points to the port in that service:

> myPort = myService:getPort("MyPort")

I can then ask for information about that port:

> return myPort
MyPort [in, /std_msgs/String, unconn, local] // Input port for receiving data.

How do use the deployer to connect that port to a ROS topic?

I have tried:

> depl:stream("MyService.MyPort", rtt.provides("ros"):topic("/my_input_data"))
1900.482 [ ERROR ][OperationCallerC] No such component: 'MyService' when looking for port 'MyService.MyPort'

It looks like the string that that stream method is using can only refer to Orocos components and not to services.

Any ideas?

Thank you,

Mark Pape

Streaming ports in a service to ROS

Hi Mark,

On Thu, Jan 03, 2013 at 03:54:29PM -0600, Pape, Mark W. (JSC-DM441) wrote:
> I have an Orocos component called MyComponent that provides a service called
> MyService. I have added a port on that service called MyPort. When I deploy
> MyComponent, I can get a Lua variable that points to that service thusly:
>
>
> > depl:loadComponent("MyComponent", "MyComponent")
>
> > myComponent= depl:getPeer("MyComponent")
>
> > myService = myComponent:provides("MyService")
>
>
>
> I can successfully get a Lua variable that points to the port in that service:
>
>
>
> > myPort = myService:getPort("MyPort")
>
>
>
> I can then ask for information about that port:
>
>
>
> > return myPort
>
> MyPort [in, /std_msgs/String, unconn, local] // Input port for receiving data.
>
>
>
> How do use the deployer to connect that port to a ROS topic?
>
>
>
> I have tried:
>
>
>
> > depl:stream("MyService.MyPort", rtt.provides("ros"):topic("/my_input_data”))
>
> 1900.482 [ ERROR ][OperationCallerC] No such component: 'MyService' when
> looking for port 'MyService.MyPort'

You need to add the component name to the string for the deployer to
know which port to stream:

depl:stream("MyComponent.MyService.MyPort", rtt.provides("ros"):topic("/my_input_data"))

Best regards
Markus