connpolicy in oro_main?

Dear comrades,

I am trying to set the connpolicy of a port from the oro_main, to configure a port to post as a topic in ROS, but i don't know how to proceed. In fact i am trying to emulate the behaveur of a the xml launch file that would be like:

<struct name="ROSConDoubleOut" type="ConnPolicy">
<simple name="type" type="short"><value>0<value><simple>

<simple name="size" type="short"><value>1<value><simple>

<simple name="transport" type="short"><value>3<value><simple>

<simple name="name_id" type="string"><value>double_orocos_to_ros<value><simple>

<struct>

<struct name="ControllerTest" type="ControllerTest">
<struct name="Activity" type="PeriodicActivity">
<simple name="Period" type="double"><value>1<value><simple>
<simple name="Priority" type="short"><value>0<value><simple>
<simple name="Scheduler" type="string"><value>ORO_SCHED_RT<value><simple>
<struct>
<simple name="AutoConf" type="boolean"><value>1<value><simple>
<simple name="AutoStart" type="boolean"><value>1<value><simple>
<struct name="Ports" type="PropertyBag">
<simple name="ros_double_out" type="string"><value> ROSConDoubleOut <value><simple>
<struct>
<simple name="Service" type="string"><value>rosparam<value><simple>
<struct>

I have an Orocos component, OroComp, with a port named, say:
RTT::OutputPort<std::vector

i have added it in the constructor component with:
this->ports()->addPort("myPortName",myPort);

and now i have an

OroComp TheComp("TheCompName");

int ORO_main(int argc, char** argv)
{
// Orocos ports
// Connection policies
ConnPolicy connpol(0, 2);
connpol.type = 0; // data
connpol.size = 1; // buffer size
connpol.trasport = 3; // ROS
connpol.name_id = "myPortName";

But after this i don't have any idea on how to proceed, and doing this definitely i don't see the topic in ROS :(. I guess i may have to create a propertybag and add a port as a property, but i am quite lost about it.

Has anyone gone through this or knows where i can find information on it?

Thx in advance.

Josep

connpolicy in oro_main?

2011/5/27 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...>

> Dear comrades,
>
> I am trying to set the connpolicy of a port from the oro_main, to configure
> a port to post as a topic in ROS, but i don't know how to proceed. In fact i
> am trying to emulate the behaveur of a the xml launch file that would be
> like:
>
> <struct name="ROSConDoubleOut" type="ConnPolicy">
> <simple name="type" type="short"><value>0<value><simple>&lt;!-- type of
&gt; connection: 0 means Data -->
> <simple name="size" type="short"><value>1<value><simple>&lt;!-- buffer
&gt; size -->
> <simple name="transport" type="short"><value>3<value><simple>&lt;!--3
&gt; means ROS-->
> <simple name="name_id"
> type="string"><value>double_orocos_to_ros<value><simple>&lt;!-- topic name
&gt; -->
> <struct>
>
> <struct name="ControllerTest" type="ControllerTest">
> <struct name="Activity" type="PeriodicActivity">
> <simple name="Period" type="double"><value>1<value><simple>
> <simple name="Priority" type="short"><value>0<value><simple>
> <simple name="Scheduler"
> type="string"><value>ORO_SCHED_RT<value><simple>
> <struct>
> <simple name="AutoConf" type="boolean"><value>1<value><simple>
> <simple name="AutoStart" type="boolean"><value>1<value><simple>
> <struct name="Ports" type="PropertyBag">
> <simple name="ros_double_out" type="string"><value>
> ROSConDoubleOut <value><simple>
> <struct>
> <simple name="Service" type="string"><value>rosparam<value><simple>
> <struct>
>
> I have an Orocos component, OroComp, with a port named, say:
> RTT::OutputPort<std::vector >
> i have added it in the constructor component with:
> this->ports()->addPort("myPortName",myPort);
>
> and now i have an
>
> OroComp TheComp("TheCompName");
>
> int ORO_main(int argc, char** argv)
> {
> // Orocos ports
> // Connection policies
> ConnPolicy connpol(0, 2);
> connpol.type = 0; // data
> connpol.size = 1; // buffer size
> connpol.trasport = 3; // ROS
> connpol.name_id = "myPortName";
>

You are near the point :
connpol.name_id Should have the rostopic in which you want to publish (I
don't know if "myPortName" is really the name of your topic)
You miss this line : stream("TheCompName.myPortName", connpol);

It should work then

>
> But after this i don't have any idea on how to proceed, and doing this
> definitely i don't see the topic in ROS :(. I guess i may have to create a
> propertybag and add a port as a property, but i am quite lost about it.
>
> Has anyone gone through this or knows where i can find information on it?
>
> Thx in advance.
>
> Josep
>
>
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>
>

connpolicy in oro_main?

Hi, Willy

i do:

RTT::internal::ConnFactory::createStream(TheCompName.myPort, connpol);

It compiles ok, but when i execute from ros i get the message:

0.214 [
Warning][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
The protocol with id 3 did not register a fall-back handler for unknown
types!

0.214 [
Warning][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
triggered by: unknown_t which does not have a transport.

0.214 [ ERROR
][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
Could not create transport stream for port msrJntPos with transport id 3

0.214 [ ERROR
][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
No such transport registered. Check your policy.transport settings or
add the transport for type array

do you have any idea what i might be doing wrong?

Josep

Date: Fri, 27 May 2011 21:49:30 +0200
Subject: Re: [Orocos-users] connpolicy in oro_main?
From: lambert [dot] willy [..] ...
To: jsprnclrtrbrt [..] ...
CC: orocos-users [..] ...

2011/5/27 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...>

Dear comrades,

I am trying to set the connpolicy of a port from the oro_main, to configure a port to post as a topic in ROS, but i don't know how to proceed. In fact i am trying to emulate the behaveur of a the xml launch file that would be like:

<struct name="ROSConDoubleOut" type="ConnPolicy">
<simple name="type" type="short"><value>0<value><simple>

<simple name="size" type="short"><value>1<value><simple>

<simple name="transport" type="short"><value>3<value><simple>

<simple name="name_id" type="string"><value>double_orocos_to_ros<value><simple>

<struct>

<struct name="ControllerTest" type="ControllerTest">

<struct name="Activity" type="PeriodicActivity">
<simple name="Period" type="double"><value>1<value><simple>
<simple name="Priority" type="short"><value>0<value><simple>

<simple name="Scheduler" type="string"><value>ORO_SCHED_RT<value><simple>
<struct>
<simple name="AutoConf" type="boolean"><value>1<value><simple>

<simple name="AutoStart" type="boolean"><value>1<value><simple>
<struct name="Ports" type="PropertyBag">
<simple name="ros_double_out" type="string"><value> ROSConDoubleOut <value><simple>

<struct>
<simple name="Service" type="string"><value>rosparam<value><simple>
<struct>

I have an Orocos component, OroComp, with a port named, say:

RTT::OutputPort<std::vector

i have added it in the constructor component with:
this->ports()->addPort("myPortName",myPort);

and now i have an

OroComp TheComp("TheCompName");

int ORO_main(int argc, char** argv)
{
// Orocos ports
// Connection policies
ConnPolicy connpol(0, 2);
connpol.type = 0; // data
connpol.size = 1; // buffer size

connpol.trasport = 3; // ROS
connpol.name_id = "myPortName";

You are near the point :
connpol.name_id Should have the rostopic in which you want to publish (I don't know if "myPortName" is really the name of your topic)

You miss this line : stream("TheCompName.myPortName", connpol);

It should work then

But after this i don't have any idea on how to proceed, and doing this definitely i don't see the topic in ROS :(. I guess i may have to create a propertybag and add a port as a property, but i am quite lost about it.

Has anyone gone through this or knows where i can find information on it?

Thx in advance.

Josep

--

Orocos-Users mailing list

Orocos-Users [..] ...

http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users

connpolicy in oro_main?

2011/5/30 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...>

> Hi, Willy
>
> i do:
>
> RTT::internal::ConnFactory::createStream(TheCompName.myPort, connpol);
>
> It compiles ok, but when i execute from ros i get the message:
>
> 0.214 [
> Warning][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
> The protocol with id 3 did not register a fall-back handler for unknown
> types!
> 0.214 [
> Warning][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
> triggered by: unknown_t which does not have a transport.
> 0.214 [ ERROR
> ][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
> Could not create transport stream for port msrJntPos with transport id 3
> 0.214 [ ERROR
> ][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
> No such transport registered. Check your policy.transport settings or add
> the transport for type array
>
> do you have any idea what i might be doing wrong?
>

Here is my sample deployment :

require("ros_integration");
var ConnPolicy start;
start.transport = 3; // ROS == 3
start.name_id = "/Protokrot/start"; // ros topic
stream("Protokrot.outIoStart", start);

Check that the port you are linking to ROS is a "ROS type" (bool, double,
... are not working, but std_msgs::Bool do for instance)

>
> Josep
>
>
> ------------------------------
> Date: Fri, 27 May 2011 21:49:30 +0200
> Subject: Re: [Orocos-users] connpolicy in oro_main?
> From: lambert [dot] willy [..] ...
> To: jsprnclrtrbrt [..] ...
> CC: orocos-users [..] ...
>
>
>
>
> 2011/5/27 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...>
>
> Dear comrades,
>
> I am trying to set the connpolicy of a port from the oro_main, to configure
> a port to post as a topic in ROS, but i don't know how to proceed. In fact i
> am trying to emulate the behaveur of a the xml launch file that would be
> like:
>
> <struct name="ROSConDoubleOut" type="ConnPolicy">
> <simple name="type" type="short"><value>0<value><simple>&lt;!-- type of
&gt; connection: 0 means Data -->
> <simple name="size" type="short"><value>1<value><simple>&lt;!-- buffer
&gt; size -->
> <simple name="transport" type="short"><value>3<value><simple>&lt;!--3
&gt; means ROS-->
> <simple name="name_id"
> type="string"><value>double_orocos_to_ros<value><simple>&lt;!-- topic name
&gt; -->
> <struct>
>
> <struct name="ControllerTest" type="ControllerTest">
> <struct name="Activity" type="PeriodicActivity">
> <simple name="Period" type="double"><value>1<value><simple>
> <simple name="Priority" type="short"><value>0<value><simple>
> <simple name="Scheduler"
> type="string"><value>ORO_SCHED_RT<value><simple>
> <struct>
> <simple name="AutoConf" type="boolean"><value>1<value><simple>
> <simple name="AutoStart" type="boolean"><value>1<value><simple>
> <struct name="Ports" type="PropertyBag">
> <simple name="ros_double_out" type="string"><value>
> ROSConDoubleOut <value><simple>
> <struct>
> <simple name="Service" type="string"><value>rosparam<value><simple>
> <struct>
>
> I have an Orocos component, OroComp, with a port named, say:
> RTT::OutputPort<std::vector >
> i have added it in the constructor component with:
> this->ports()->addPort("myPortName",myPort);
>
> and now i have an
>
> OroComp TheComp("TheCompName");
>
> int ORO_main(int argc, char** argv)
> {
> // Orocos ports
> // Connection policies
> ConnPolicy connpol(0, 2);
> connpol.type = 0; // data
> connpol.size = 1; // buffer size
> connpol.trasport = 3; // ROS
> connpol.name_id = "myPortName";
>
>
> You are near the point :
> connpol.name_id Should have the rostopic in which you want to publish (I
> don't know if "myPortName" is really the name of your topic)
> You miss this line : stream("TheCompName.myPortName", connpol);
>
> It should work then
>
>
>
>
> But after this i don't have any idea on how to proceed, and doing this
> definitely i don't see the topic in ROS :(. I guess i may have to create a
> propertybag and add a port as a property, but i am quite lost about it.
>
> Has anyone gone through this or knows where i can find information on it?
>
> Thx in advance.
>
> Josep
>
>
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>
>
>

connpolicy in oro_main?

2011/5/30 Willy Lambert <lambert [dot] willy [..] ...>

>
>
> 2011/5/30 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...>
>
>> Hi, Willy
>>
>> i do:
>>
>> RTT::internal::ConnFactory::createStream(TheCompName.myPort, connpol);
>>
>> It compiles ok, but when i execute from ros i get the message:
>>
>> 0.214 [
>> Warning][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
>> The protocol with id 3 did not register a fall-back handler for unknown
>> types!
>> 0.214 [
>> Warning][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
>> triggered by: unknown_t which does not have a transport.
>> 0.214 [ ERROR
>> ][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
>> Could not create transport stream for port msrJntPos with transport id 3
>> 0.214 [ ERROR
>> ][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
>> No such transport registered. Check your policy.transport settings or add
>> the transport for type array
>>
>> do you have any idea what i might be doing wrong?
>>
>
> Here is my sample deployment :
>
>
> require("ros_integration");
> var ConnPolicy start;
> start.transport = 3; // ROS == 3
> start.name_id = "/Protokrot/start"; // ros topic
> stream("Protokrot.outIoStart", start);
>

It is orocos script syntax, I don't know how to do it in C++

>
> Check that the port you are linking to ROS is a "ROS type" (bool, double,
> ... are not working, but std_msgs::Bool do for instance)
>
>
>
>>
>> Josep
>>
>>
>> ------------------------------
>> Date: Fri, 27 May 2011 21:49:30 +0200
>> Subject: Re: [Orocos-users] connpolicy in oro_main?
>> From: lambert [dot] willy [..] ...
>> To: jsprnclrtrbrt [..] ...
>> CC: orocos-users [..] ...
>>
>>
>>
>>
>> 2011/5/27 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...>
>>
>> Dear comrades,
>>
>> I am trying to set the connpolicy of a port from the oro_main, to
>> configure a port to post as a topic in ROS, but i don't know how to proceed.
>> In fact i am trying to emulate the behaveur of a the xml launch file that
>> would be like:
>>
>> <struct name="ROSConDoubleOut" type="ConnPolicy">
>> <simple name="type" type="short"><value>0<value><simple>&lt;!-- type
&gt;> of connection: 0 means Data -->
>> <simple name="size" type="short"><value>1<value><simple>&lt;!-- buffer
&gt;> size -->
>> <simple name="transport" type="short"><value>3<value><simple>&lt;!--3
&gt;> means ROS-->
>> <simple name="name_id"
>> type="string"><value>double_orocos_to_ros<value><simple>&lt;!-- topic name
&gt;> -->
>> <struct>
>>
>> <struct name="ControllerTest" type="ControllerTest">
>> <struct name="Activity" type="PeriodicActivity">
>> <simple name="Period" type="double"><value>1<value><simple>
>> <simple name="Priority" type="short"><value>0<value><simple>
>> <simple name="Scheduler"
>> type="string"><value>ORO_SCHED_RT<value><simple>
>> <struct>
>> <simple name="AutoConf" type="boolean"><value>1<value><simple>
>> <simple name="AutoStart" type="boolean"><value>1<value><simple>
>> <struct name="Ports" type="PropertyBag">
>> <simple name="ros_double_out" type="string"><value>
>> ROSConDoubleOut <value><simple>
>> <struct>
>> <simple name="Service" type="string"><value>rosparam<value><simple>
>> <struct>
>>
>> I have an Orocos component, OroComp, with a port named, say:
>> RTT::OutputPort<std::vector >>
>> i have added it in the constructor component with:
>> this->ports()->addPort("myPortName",myPort);
>>
>> and now i have an
>>
>> OroComp TheComp("TheCompName");
>>
>> int ORO_main(int argc, char** argv)
>> {
>> // Orocos ports
>> // Connection policies
>> ConnPolicy connpol(0, 2);
>> connpol.type = 0; // data
>> connpol.size = 1; // buffer size
>> connpol.trasport = 3; // ROS
>> connpol.name_id = "myPortName";
>>
>>
>> You are near the point :
>> connpol.name_id Should have the rostopic in which you want to publish (I
>> don't know if "myPortName" is really the name of your topic)
>> You miss this line : stream("TheCompName.myPortName", connpol);
>>
>> It should work then
>>
>>
>>
>>
>> But after this i don't have any idea on how to proceed, and doing this
>> definitely i don't see the topic in ROS :(. I guess i may have to create a
>> propertybag and add a port as a property, but i am quite lost about it.
>>
>> Has anyone gone through this or knows where i can find information on it?
>>
>> Thx in advance.
>>
>> Josep
>>
>>
>> --
>> Orocos-Users mailing list
>> Orocos-Users [..] ...
>> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>>
>>
>>
>

connpolicy in oro_main?

Hi Willy,

seems that the point is that i need to use a ROS msg, even for a simple bool msg. That means that i have to do the typekit and that the orocos node will have to work also with the ros msg, which i dont want. I want the orocos node to work with a vector of double.

I found another option which is to connect to the component output ports with input ports in the oro_main, get those values and then publish them to ros with a normal ros publisher. I guess this should work fine.

I have a question, thought. As i have to connect the input and output ports with

static bool createConnection(OutputPort<T>& output_port, base::InputPortInterface& input_port, ConnPolicy const& policy)

for each connection -and i have quite a lot of connections-, and all my policies are the same, I was wondering if i have to create one policy per connection or i can just create one and give it to all the createConnection functions (yes, lazy me!).

Besides that, thx for ur help, as it helps me keep going!

Josep

Date: Mon, 30 May 2011 18:50:40 +0200
Subject: Re: [Orocos-users] connpolicy in oro_main?
From: lambert [dot] willy [..] ...
To: jsprnclrtrbrt [..] ...
CC: orocos-users [..] ...

2011/5/30 Willy Lambert <lambert [dot] willy [..] ...>

2011/5/30 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...>

Hi, Willy

i do:

RTT::internal::ConnFactory::createStream(TheCompName.myPort, connpol);

It compiles ok, but when i execute from ros i get the message:

0.214 [
Warning][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
The protocol with id 3 did not register a fall-back handler for unknown
types!

0.214 [
Warning][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
triggered by: unknown_t which does not have a transport.

0.214 [ ERROR
][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
Could not create transport stream for port msrJntPos with transport id 3

0.214 [ ERROR
][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
No such transport registered. Check your policy.transport settings or
add the transport for type array

do you have any idea what i might be doing wrong?

Here is my sample deployment :

require("ros_integration");
var ConnPolicy start;
start.transport = 3; // ROS == 3

start.name_id = "/Protokrot/start"; // ros topic
stream("Protokrot.outIoStart", start);

It is orocos script syntax, I don't know how to do it in C++

Check that the port you are linking to ROS is a "ROS type" (bool, double, ... are not working, but std_msgs::Bool do for instance)

Josep

Date: Fri, 27 May 2011 21:49:30 +0200
Subject: Re: [Orocos-users] connpolicy in oro_main?
From: lambert [dot] willy [..] ...

To: jsprnclrtrbrt [..] ...
CC: orocos-users [..] ...

2011/5/27 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...>

Dear comrades,

I am trying to set the connpolicy of a port from the oro_main, to configure a port to post as a topic in ROS, but i don't know how to proceed. In fact i am trying to emulate the behaveur of a the xml launch file that would be like:

<struct name="ROSConDoubleOut" type="ConnPolicy">
<simple name="type" type="short"><value>0<value><simple>

<simple name="size" type="short"><value>1<value><simple>

<simple name="transport" type="short"><value>3<value><simple>

<simple name="name_id" type="string"><value>double_orocos_to_ros<value><simple>

<struct>

<struct name="ControllerTest" type="ControllerTest">

<struct name="Activity" type="PeriodicActivity">
<simple name="Period" type="double"><value>1<value><simple>
<simple name="Priority" type="short"><value>0<value><simple>

<simple name="Scheduler" type="string"><value>ORO_SCHED_RT<value><simple>
<struct>
<simple name="AutoConf" type="boolean"><value>1<value><simple>

<simple name="AutoStart" type="boolean"><value>1<value><simple>
<struct name="Ports" type="PropertyBag">
<simple name="ros_double_out" type="string"><value> ROSConDoubleOut <value><simple>

<struct>
<simple name="Service" type="string"><value>rosparam<value><simple>
<struct>

I have an Orocos component, OroComp, with a port named, say:

RTT::OutputPort<std::vector

i have added it in the constructor component with:
this->ports()->addPort("myPortName",myPort);

and now i have an

OroComp TheComp("TheCompName");

int ORO_main(int argc, char** argv)
{
// Orocos ports
// Connection policies
ConnPolicy connpol(0, 2);
connpol.type = 0; // data
connpol.size = 1; // buffer size

connpol.trasport = 3; // ROS
connpol.name_id = "myPortName";

You are near the point :
connpol.name_id Should have the rostopic in which you want to publish (I don't know if "myPortName" is really the name of your topic)

You miss this line : stream("TheCompName.myPortName", connpol);

It should work then

But after this i don't have any idea on how to proceed, and doing this definitely i don't see the topic in ROS :(. I guess i may have to create a propertybag and add a port as a property, but i am quite lost about it.

Has anyone gone through this or knows where i can find information on it?

Thx in advance.

Josep

--

Orocos-Users mailing list

Orocos-Users [..] ...

http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users

connpolicy in oro_main?

2011/5/30 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...>

> Hi Willy,
>
> seems that the point is that i need to use a ROS msg, even for a simple
> bool msg. That means that i have to do the typekit and that the orocos node
> will have to work also with the ros msg, which i dont want. I want the
> orocos node to work with a vector of double.
>

You have some pre-existing typekit in the orocos_ros_toolchain. You should
really use them when possible as it will save your time. I sometimes use ROS
types in Orocos component to help ROS integration.
You canuse the port as a vector of double and create a copy of it in a ROS
type for ROS (be aware of latency, it depends of the reason why you
interface with ROS, debug datas ? displaying ? high frequency datas ?)

>
> I found another option which is to connect to the component output ports
> with input ports in the oro_main, get those values and then publish them to
> ros with a normal ros publisher. I guess this should work fine.
>
> I have a question, thought. As i have to connect the input and output ports
> with
>
> static bool createConnection(OutputPort<T><http://people.mech.kuleuven.be/%7Eorocos/pub/documentation/rtt/v2.0.x/api/html/classRTT_1_1OutputPort.html>&
> output_port, base::InputPortInterface<http://people.mech.kuleuven.be/%7Eorocos/pub/documentation/rtt/v2.0.x/api/html/classRTT_1_1base_1_1InputPortInterface.html>&
> input_port, ConnPolicy<http://people.mech.kuleuven.be/%7Eorocos/pub/documentation/rtt/v2.0.x/api/html/classRTT_1_1ConnPolicy.html>
> const& policy)
>
> for each connection -and i have quite a lot of connections-, and all my
> policies are the same, I was wondering if i have to create one policy per
> connection or i can just create one and give it to all the createConnection
> functions (yes, lazy me!).
>

As Ruben said, the Ros topic name has to be defined (it's *your* choice as
for a port name) so you'll have to type as many lines as topic name you want
to create. If you really have many of them you should create some naming
rules like portName=topicName (which is again *your choice) and automate
this port creation with a createRosPort('portName") function of your own.

>
> Besides that, thx for ur help, as it helps me keep going!
>
> Josep
>
> ------------------------------
> Date: Mon, 30 May 2011 18:50:40 +0200
>
> Subject: Re: [Orocos-users] connpolicy in oro_main?
> From: lambert [dot] willy [..] ...
> To: jsprnclrtrbrt [..] ...
> CC: orocos-users [..] ...
>
>
>
> 2011/5/30 Willy Lambert <lambert [dot] willy [..] ...>
>
>
>
> 2011/5/30 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...>
>
> Hi, Willy
>
> i do:
>
> RTT::internal::ConnFactory::createStream(TheCompName.myPort, connpol);
>
> It compiles ok, but when i execute from ros i get the message:
>
> 0.214 [
> Warning][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
> The protocol with id 3 did not register a fall-back handler for unknown
> types!
> 0.214 [
> Warning][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
> triggered by: unknown_t which does not have a transport.
> 0.214 [ ERROR
> ][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
> Could not create transport stream for port msrJntPos with transport id 3
> 0.214 [ ERROR
> ][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
> No such transport registered. Check your policy.transport settings or add
> the transport for type array
>
> do you have any idea what i might be doing wrong?
>
>
> Here is my sample deployment :
>
>
> require("ros_integration");
> var ConnPolicy start;
> start.transport = 3; // ROS == 3
> start.name_id = "/Protokrot/start"; // ros topic
> stream("Protokrot.outIoStart", start);
>
>
> It is orocos script syntax, I don't know how to do it in C++
>
>
>
> Check that the port you are linking to ROS is a "ROS type" (bool, double,
> ... are not working, but std_msgs::Bool do for instance)
>
>
>
>
> Josep
>
>
> ------------------------------
> Date: Fri, 27 May 2011 21:49:30 +0200
> Subject: Re: [Orocos-users] connpolicy in oro_main?
> From: lambert [dot] willy [..] ...
> To: jsprnclrtrbrt [..] ...
> CC: orocos-users [..] ...
>
>
>
>
> 2011/5/27 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...>
>
> Dear comrades,
>
> I am trying to set the connpolicy of a port from the oro_main, to configure
> a port to post as a topic in ROS, but i don't know how to proceed. In fact i
> am trying to emulate the behaveur of a the xml launch file that would be
> like:
>
> <struct name="ROSConDoubleOut" type="ConnPolicy">
> <simple name="type" type="short"><value>0<value><simple>&lt;!-- type of
&gt; connection: 0 means Data -->
> <simple name="size" type="short"><value>1<value><simple>&lt;!-- buffer
&gt; size -->
> <simple name="transport" type="short"><value>3<value><simple>&lt;!--3
&gt; means ROS-->
> <simple name="name_id"
> type="string"><value>double_orocos_to_ros<value><simple>&lt;!-- topic name
&gt; -->
> <struct>
>
> <struct name="ControllerTest" type="ControllerTest">
> <struct name="Activity" type="PeriodicActivity">
> <simple name="Period" type="double"><value>1<value><simple>
> <simple name="Priority" type="short"><value>0<value><simple>
> <simple name="Scheduler"
> type="string"><value>ORO_SCHED_RT<value><simple>
> <struct>
> <simple name="AutoConf" type="boolean"><value>1<value><simple>
> <simple name="AutoStart" type="boolean"><value>1<value><simple>
> <struct name="Ports" type="PropertyBag">
> <simple name="ros_double_out" type="string"><value>
> ROSConDoubleOut <value><simple>
> <struct>
> <simple name="Service" type="string"><value>rosparam<value><simple>
> <struct>
>
> I have an Orocos component, OroComp, with a port named, say:
> RTT::OutputPort<std::vector >
> i have added it in the constructor component with:
> this->ports()->addPort("myPortName",myPort);
>
> and now i have an
>
> OroComp TheComp("TheCompName");
>
> int ORO_main(int argc, char** argv)
> {
> // Orocos ports
> // Connection policies
> ConnPolicy connpol(0, 2);
> connpol.type = 0; // data
> connpol.size = 1; // buffer size
> connpol.trasport = 3; // ROS
> connpol.name_id = "myPortName";
>
>
> You are near the point :
> connpol.name_id Should have the rostopic in which you want to publish (I
> don't know if "myPortName" is really the name of your topic)
> You miss this line : stream("TheCompName.myPortName", connpol);
>
> It should work then
>
>
>
>
> But after this i don't have any idea on how to proceed, and doing this
> definitely i don't see the topic in ROS :(. I guess i may have to create a
> propertybag and add a port as a property, but i am quite lost about it.
>
> Has anyone gone through this or knows where i can find information on it?
>
> Thx in advance.
>
> Josep
>
>
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>
>
>
>
>

connpolicy in oro_main?

Hi all,

the thing is that i have an orocos component that i don't want to change, that is, add to it the ros typekit (the include, and writing/reading the typekit ports), as i want to keep it orocos "pure". But i want to see its attributes, properties and ports from ros, so i decided to construct a mixed ros/orocos node which in oro_main (where all the ros stuff is added: ros while, publishers, etc) initializes the orocos component, so then it is able to ask for its attributes and properties, "linked" to ros services.

Then i also need to "link" the ports to subscribers/publishers. As my idea is not to change the original orocos component, I though on the mixed ros/orocos node reading and writing the orocos ports and then doing the brigde to the subscribers/publishers of ros.

maybe i should rethink it all, please id really like to hear ur opinion on this, as I am very new to orocos, and maybe my solution is umm... lets say, silly :P.

Thx in advance.

Josep

(I decided to choose the oro_main as the base to start the orocos component and create the input/output ports and all, as it was easy to mix with the ros main, but if you think its more efficient to use the deployer component to do that, i might change that also)

Date: Mon, 30 May 2011 22:15:34 +0200
Subject: Re: [Orocos-users] connpolicy in oro_main?
From: lambert [dot] willy [..] ...
To: jsprnclrtrbrt [..] ...
CC: orocos-users [..] ...

2011/5/30 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...>

Hi Willy,

seems that the point is that i need to use a ROS msg, even for a simple bool msg. That means that i have to do the typekit and that the orocos node will have to work also with the ros msg, which i dont want. I want the orocos node to work with a vector of double.

You have some pre-existing typekit in the orocos_ros_toolchain. You should really use them when possible as it will save your time. I sometimes use ROS types in Orocos component to help ROS integration.

You canuse the port as a vector of double and create a copy of it in a ROS type for ROS (be aware of latency, it depends of the reason why you interface with ROS, debug datas ? displaying ? high frequency datas ?)

I found another option which is to connect to the component output ports with input ports in the oro_main, get those values and then publish them to ros with a normal ros publisher. I guess this should work fine.

I have a question, thought. As i have to connect the input and output ports with

static bool createConnection(OutputPort<T>& output_port, base::InputPortInterface& input_port, ConnPolicy const& policy)

for each connection -and i have quite a lot of connections-, and all my policies are the same, I was wondering if i have to create one policy per connection or i can just create one and give it to all the createConnection functions (yes, lazy me!).

As Ruben said, the Ros topic name has to be defined (it's *your* choice as for a port name) so you'll have to type as many lines as topic name you want to create. If you really have many of them you should create some naming rules like portName=topicName (which is again *your choice) and automate this port creation with a createRosPort('portName") function of your own.

Besides that, thx for ur help, as it helps me keep going!

Josep

Date: Mon, 30 May 2011 18:50:40 +0200
Subject: Re: [Orocos-users] connpolicy in oro_main?
From: lambert [dot] willy [..] ...

To: jsprnclrtrbrt [..] ...
CC: orocos-users [..] ...

2011/5/30 Willy Lambert <lambert [dot] willy [..] ...>

2011/5/30 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...>

Hi, Willy

i do:

RTT::internal::ConnFactory::createStream(TheCompName.myPort, connpol);

It compiles ok, but when i execute from ros i get the message:

0.214 [
Warning][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
The protocol with id 3 did not register a fall-back handler for unknown
types!

0.214 [
Warning][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
triggered by: unknown_t which does not have a transport.

0.214 [ ERROR
][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
Could not create transport stream for port msrJntPos with transport id 3

0.214 [ ERROR
][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()]
No such transport registered. Check your policy.transport settings or
add the transport for type array

do you have any idea what i might be doing wrong?

Here is my sample deployment :

require("ros_integration");
var ConnPolicy start;
start.transport = 3; // ROS == 3

start.name_id = "/Protokrot/start"; // ros topic
stream("Protokrot.outIoStart", start);

It is orocos script syntax, I don't know how to do it in C++

Check that the port you are linking to ROS is a "ROS type" (bool, double, ... are not working, but std_msgs::Bool do for instance)

Josep

Date: Fri, 27 May 2011 21:49:30 +0200
Subject: Re: [Orocos-users] connpolicy in oro_main?
From: lambert [dot] willy [..] ...

To: jsprnclrtrbrt [..] ...
CC: orocos-users [..] ...

2011/5/27 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...>

Dear comrades,

I am trying to set the connpolicy of a port from the oro_main, to configure a port to post as a topic in ROS, but i don't know how to proceed. In fact i am trying to emulate the behaveur of a the xml launch file that would be like:

<struct name="ROSConDoubleOut" type="ConnPolicy">
<simple name="type" type="short"><value>0<value><simple>

<simple name="size" type="short"><value>1<value><simple>

<simple name="transport" type="short"><value>3<value><simple>

<simple name="name_id" type="string"><value>double_orocos_to_ros<value><simple>

<struct>

<struct name="ControllerTest" type="ControllerTest">

<struct name="Activity" type="PeriodicActivity">
<simple name="Period" type="double"><value>1<value><simple>
<simple name="Priority" type="short"><value>0<value><simple>

<simple name="Scheduler" type="string"><value>ORO_SCHED_RT<value><simple>
<struct>
<simple name="AutoConf" type="boolean"><value>1<value><simple>

<simple name="AutoStart" type="boolean"><value>1<value><simple>
<struct name="Ports" type="PropertyBag">
<simple name="ros_double_out" type="string"><value> ROSConDoubleOut <value><simple>

<struct>
<simple name="Service" type="string"><value>rosparam<value><simple>
<struct>

I have an Orocos component, OroComp, with a port named, say:

RTT::OutputPort<std::vector

i have added it in the constructor component with:
this->ports()->addPort("myPortName",myPort);

and now i have an

OroComp TheComp("TheCompName");

int ORO_main(int argc, char** argv)
{
// Orocos ports
// Connection policies
ConnPolicy connpol(0, 2);
connpol.type = 0; // data
connpol.size = 1; // buffer size

connpol.trasport = 3; // ROS
connpol.name_id = "myPortName";

You are near the point :
connpol.name_id Should have the rostopic in which you want to publish (I don't know if "myPortName" is really the name of your topic)

You miss this line : stream("TheCompName.myPortName", connpol);

It should work then

But after this i don't have any idea on how to proceed, and doing this definitely i don't see the topic in ROS :(. I guess i may have to create a propertybag and add a port as a property, but i am quite lost about it.

Has anyone gone through this or knows where i can find information on it?

Thx in advance.

Josep

--

Orocos-Users mailing list

Orocos-Users [..] ...

http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users

connpolicy in oro_main?

On Tue, 31 May 2011, Josep Arnau Claret Robert wrote:

> Hi all,
>
> the thing is that i have an orocos component that i don't want to change, that is, add to it the ros typekit (the include, and writing/reading the typekit ports), as i want to keep it orocos "pure". But i want to see its attributes, properties and ports from ros, so i decided to construct a mixed ros/orocos node which in oro_main (where all the ros stuff is added: ros while, publishers, etc) initializes the orocos component, so then it is able to ask for its attributes and properties, "linked" to ros services.
>
> Then i also need to "link" the ports to subscribers/publishers. As my idea is not to change the original orocos component, I though on the mixed ros/orocos node reading and writing the orocos ports and then doing the brigde to the subscribers/publishers of ros.
>
> maybe i should rethink it all, please id really like to hear ur opinion on this, as I am very new to orocos, and maybe my solution is umm... lets say, silly :P.

Personally, I don't think you have another option, given your constraints.
(And given that I understand exactly what you mean...)

I even think you have the best possible solution, given that the ROS
"component model" is less rich than Orocos', in the sense that it does not
differentiate between different kind of "ports" (event, data,
configuration). So, a one-on-one mapping between both component models is
not possible, and compromises have to be made.

> Thx in advance.
>
> Josep

> (I decided to choose the oro_main as the base to start the orocos
> component and create the input/output ports and all, as it was easy to
> mix with the ros main, but if you think its more efficient to use the
> deployer component to do that, i might change that also)

Define "more efficient"....

Herman

> ________________________________
> Date: Mon, 30 May 2011 22:15:34 +0200
> Subject: Re: [Orocos-users] connpolicy in oro_main?
> From: lambert [dot] willy [..] ...
> To: jsprnclrtrbrt [..] ...
> CC: orocos-users [..] ...
>
>
>
> 2011/5/30 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...jsprnclrtrbrt [..] ...>>
> Hi Willy,
>
> seems that the point is that i need to use a ROS msg, even for a simple bool msg. That means that i have to do the typekit and that the orocos node will have to work also with the ros msg, which i dont want. I want the orocos node to work with a vector of double.
>
> You have some pre-existing typekit in the orocos_ros_toolchain. You should really use them when possible as it will save your time. I sometimes use ROS types in Orocos component to help ROS integration.
> You canuse the port as a vector of double and create a copy of it in a ROS type for ROS (be aware of latency, it depends of the reason why you interface with ROS, debug datas ? displaying ? high frequency datas ?)
>
>
> I found another option which is to connect to the component output ports with input ports in the oro_main, get those values and then publish them to ros with a normal ros publisher. I guess this should work fine.
>
> I have a question, thought. As i have to connect the input and output ports with
>
> static bool createConnection(OutputPort<T><http://people.mech.kuleuven.be/%7Eorocos/pub/documentation/rtt/v2.0.x/api/html/classRTT_1_1OutputPort.html>& output_port, base::InputPortInterface<http://people.mech.kuleuven.be/%7Eorocos/pub/documentation/rtt/v2.0.x/api/html/classRTT_1_1base_1_1InputPortInterface.html>& input_port, ConnPolicy<http://people.mech.kuleuven.be/%7Eorocos/pub/documentation/rtt/v2.0.x/api/html/classRTT_1_1ConnPolicy.html> const& policy)
>
> for each connection -and i have quite a lot of connections-, and all my policies are the same, I was wondering if i have to create one policy per connection or i can just create one and give it to all the createConnection functions (yes, lazy me!).
>
> As Ruben said, the Ros topic name has to be defined (it's *your* choice as for a port name) so you'll have to type as many lines as topic name you want to create. If you really have many of them you should create some naming rules like portName=topicName (which is again *your choice) and automate this port creation with a createRosPort('portName") function of your own.
>
>
> Besides that, thx for ur help, as it helps me keep going!
>
> Josep
>
> ________________________________
> Date: Mon, 30 May 2011 18:50:40 +0200
>
> Subject: Re: [Orocos-users] connpolicy in oro_main?
> From: lambert [dot] willy [..] ...<mailto:lambert [dot] willy [..] ...>
> To: jsprnclrtrbrt [..] ...<mailto:jsprnclrtrbrt [..] ...>
> CC: orocos-users [..] ...<mailto:orocos-users [..] ...>
>
>
>
> 2011/5/30 Willy Lambert <lambert [dot] willy [..] ...lambert [dot] willy [..] ...>>
>
>
> 2011/5/30 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...jsprnclrtrbrt [..] ...>>
> Hi, Willy
>
> i do:
>
> RTT::internal::ConnFactory::createStream(TheCompName.myPort, connpol);
>
> It compiles ok, but when i execute from ros i get the message:
>
> 0.214 [ Warning][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()] The protocol with id 3 did not register a fall-back handler for unknown types!
> 0.214 [ Warning][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()] triggered by: unknown_t which does not have a transport.
> 0.214 [ ERROR ][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()] Could not create transport stream for port msrJntPos with transport id 3
> 0.214 [ ERROR ][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()] No such transport registered. Check your policy.transport settings or add the transport for type array
>
> do you have any idea what i might be doing wrong?
>
> Here is my sample deployment :
>
>
> require("ros_integration");
> var ConnPolicy start;
> start.transport = 3; // ROS == 3
> start.name_id = "/Protokrot/start"; // ros topic
> stream("Protokrot.outIoStart", start);
>
> It is orocos script syntax, I don't know how to do it in C++
>
>
> Check that the port you are linking to ROS is a "ROS type" (bool, double, ... are not working, but std_msgs::Bool do for instance)
>
>
>
> Josep
>
>
> ________________________________
> Date: Fri, 27 May 2011 21:49:30 +0200
> Subject: Re: [Orocos-users] connpolicy in oro_main?
> From: lambert [dot] willy [..] ...<mailto:lambert [dot] willy [..] ...>
> To: jsprnclrtrbrt [..] ...<mailto:jsprnclrtrbrt [..] ...>
> CC: orocos-users [..] ...<mailto:orocos-users [..] ...>
>
>
>
>
> 2011/5/27 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...jsprnclrtrbrt [..] ...>>
> Dear comrades,
>
> I am trying to set the connpolicy of a port from the oro_main, to configure a port to post as a topic in ROS, but i don't know how to proceed. In fact i am trying to emulate the behaveur of a the xml launch file that would be like:
>
> <struct name="ROSConDoubleOut" type="ConnPolicy">
> <simple name="type" type="short"><value>0<value><simple>

> <simple name="size" type="short"><value>1<value><simple>

> <simple name="transport" type="short"><value>3<value><simple>

> <simple name="name_id" type="string"><value>double_orocos_to_ros<value><simple>

> <struct>
>
> <struct name="ControllerTest" type="ControllerTest">
> <struct name="Activity" type="PeriodicActivity">
> <simple name="Period" type="double"><value>1<value><simple>
> <simple name="Priority" type="short"><value>0<value><simple>
> <simple name="Scheduler" type="string"><value>ORO_SCHED_RT<value><simple>
> <struct>
> <simple name="AutoConf" type="boolean"><value>1<value><simple>
> <simple name="AutoStart" type="boolean"><value>1<value><simple>
> <struct name="Ports" type="PropertyBag">
> <simple name="ros_double_out" type="string"><value> ROSConDoubleOut <value><simple>
> <struct>
> <simple name="Service" type="string"><value>rosparam<value><simple>
> <struct>
>
> I have an Orocos component, OroComp, with a port named, say:
> RTT::OutputPort<std::vector >
> i have added it in the constructor component with:
> this->ports()->addPort("myPortName",myPort);
>
> and now i have an
>
> OroComp TheComp("TheCompName");
>
> int ORO_main(int argc, char** argv)
> {
> // Orocos ports
> // Connection policies
> ConnPolicy connpol(0, 2);
> connpol.type = 0; // data
> connpol.size = 1; // buffer size
> connpol.trasport = 3; // ROS
> connpol.name_id = "myPortName";
>
> You are near the point :
> connpol.name_id Should have the rostopic in which you want to publish (I don't know if "myPortName" is really the name of your topic)
> You miss this line : stream("TheCompName.myPortName", connpol);
>
> It should work then
>
>
>
> But after this i don't have any idea on how to proceed, and doing this definitely i don't see the topic in ROS :(. I guess i may have to create a propertybag and add a port as a property, but i am quite lost about it.
>
> Has anyone gone through this or knows where i can find information on it?
>
> Thx in advance.
>
> Josep
>
>
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...<mailto:Orocos-Users [..] ...>
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>
>
>
>
>
>

connpolicy in oro_main?

> Date: Tue, 31 May 2011 13:42:44 +0200
> From: Herman [dot] Bruyninckx [..] ...
> To: jsprnclrtrbrt [..] ...
> CC: lambert [dot] willy [..] ...; orocos-users [..] ...; Ruben [dot] Smits [..] ...
> Subject: Re: [Orocos-users] connpolicy in oro_main?
>
> On Tue, 31 May 2011, Josep Arnau Claret Robert wrote:
>
> > Hi all,
> >
> > the thing is that i have an orocos component that i don't want to change, that is, add to it the ros typekit (the include, and writing/reading the typekit ports), as i want to keep it orocos "pure". But i want to see its attributes, properties and ports from ros, so i decided to construct a mixed ros/orocos node which in oro_main (where all the ros stuff is added: ros while, publishers, etc) initializes the orocos component, so then it is able to ask for its attributes and properties, "linked" to ros services.
> >
> > Then i also need to "link" the ports to subscribers/publishers. As my idea is not to change the original orocos component, I though on the mixed ros/orocos node reading and writing the orocos ports and then doing the brigde to the subscribers/publishers of ros.
> >
> > maybe i should rethink it all, please id really like to hear ur opinion on this, as I am very new to orocos, and maybe my solution is umm... lets say, silly :P.
>
> Personally, I don't think you have another option, given your constraints.
> (And given that I understand exactly what you mean...)
>
> I even think you have the best possible solution, given that the ROS
> "component model" is less rich than Orocos', in the sense that it does not
> differentiate between different kind of "ports" (event, data,
> configuration). So, a one-on-one mapping between both component models is
> not possible, and compromises have to be made.
>
> > Thx in advance.
> >
> > Josep
>
> > (I decided to choose the oro_main as the base to start the orocos
> > component and create the input/output ports and all, as it was easy to
> > mix with the ros main, but if you think its more efficient to use the
> > deployer component to do that, i might change that also)
>
> Define "more efficient"....

I am not really sure what efficient may be, in a Orocos context (faster? keeps better with the real time?), but in fact i was hopping that u orocos guys would know.

The question is: if i have to start a component not from another component, and from the cdeployer, but just from another C++ program, what would be the best option?

Josep

>
> Herman
>
> > ________________________________
> > Date: Mon, 30 May 2011 22:15:34 +0200
> > Subject: Re: [Orocos-users] connpolicy in oro_main?
> > From: lambert [dot] willy [..] ...
> > To: jsprnclrtrbrt [..] ...
> > CC: orocos-users [..] ...
> >
> >
> >
> > 2011/5/30 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...jsprnclrtrbrt [..] ...>>
> > Hi Willy,
> >
> > seems that the point is that i need to use a ROS msg, even for a simple bool msg. That means that i have to do the typekit and that the orocos node will have to work also with the ros msg, which i dont want. I want the orocos node to work with a vector of double.
> >
> > You have some pre-existing typekit in the orocos_ros_toolchain. You should really use them when possible as it will save your time. I sometimes use ROS types in Orocos component to help ROS integration.
> > You canuse the port as a vector of double and create a copy of it in a ROS type for ROS (be aware of latency, it depends of the reason why you interface with ROS, debug datas ? displaying ? high frequency datas ?)
> >
> >
> > I found another option which is to connect to the component output ports with input ports in the oro_main, get those values and then publish them to ros with a normal ros publisher. I guess this should work fine.
> >
> > I have a question, thought. As i have to connect the input and output ports with
> >
> > static bool createConnection(OutputPort<T><http://people.mech.kuleuven.be/%7Eorocos/pub/documentation/rtt/v2.0.x/api/html/classRTT_1_1OutputPort.html>& output_port, base::InputPortInterface<http://people.mech.kuleuven.be/%7Eorocos/pub/documentation/rtt/v2.0.x/api/html/classRTT_1_1base_1_1InputPortInterface.html>& input_port, ConnPolicy<http://people.mech.kuleuven.be/%7Eorocos/pub/documentation/rtt/v2.0.x/api/html/classRTT_1_1ConnPolicy.html> const& policy)
> >
> > for each connection -and i have quite a lot of connections-, and all my policies are the same, I was wondering if i have to create one policy per connection or i can just create one and give it to all the createConnection functions (yes, lazy me!).
> >
> > As Ruben said, the Ros topic name has to be defined (it's *your* choice as for a port name) so you'll have to type as many lines as topic name you want to create. If you really have many of them you should create some naming rules like portName=topicName (which is again *your choice) and automate this port creation with a createRosPort('portName") function of your own.
> >
> >
> > Besides that, thx for ur help, as it helps me keep going!
> >
> > Josep
> >
> > ________________________________
> > Date: Mon, 30 May 2011 18:50:40 +0200
> >
> > Subject: Re: [Orocos-users] connpolicy in oro_main?
> > From: lambert [dot] willy [..] ...<mailto:lambert [dot] willy [..] ...>
> > To: jsprnclrtrbrt [..] ...<mailto:jsprnclrtrbrt [..] ...>
> > CC: orocos-users [..] ...<mailto:orocos-users [..] ...>
> >
> >
> >
> > 2011/5/30 Willy Lambert <lambert [dot] willy [..] ...lambert [dot] willy [..] ...>>
> >
> >
> > 2011/5/30 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...jsprnclrtrbrt [..] ...>>
> > Hi, Willy
> >
> > i do:
> >
> > RTT::internal::ConnFactory::createStream(TheCompName.myPort, connpol);
> >
> > It compiles ok, but when i execute from ros i get the message:
> >
> > 0.214 [ Warning][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()] The protocol with id 3 did not register a fall-back handler for unknown types!
> > 0.214 [ Warning][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()] triggered by: unknown_t which does not have a transport.
> > 0.214 [ ERROR ][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()] Could not create transport stream for port msrJntPos with transport id 3
> > 0.214 [ ERROR ][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()] No such transport registered. Check your policy.transport settings or add the transport for type array
> >
> > do you have any idea what i might be doing wrong?
> >
> > Here is my sample deployment :
> >
> >
> > require("ros_integration");
> > var ConnPolicy start;
> > start.transport = 3; // ROS == 3
> > start.name_id = "/Protokrot/start"; // ros topic
> > stream("Protokrot.outIoStart", start);
> >
> > It is orocos script syntax, I don't know how to do it in C++
> >
> >
> > Check that the port you are linking to ROS is a "ROS type" (bool, double, ... are not working, but std_msgs::Bool do for instance)
> >
> >
> >
> > Josep
> >
> >
> > ________________________________
> > Date: Fri, 27 May 2011 21:49:30 +0200
> > Subject: Re: [Orocos-users] connpolicy in oro_main?
> > From: lambert [dot] willy [..] ...<mailto:lambert [dot] willy [..] ...>
> > To: jsprnclrtrbrt [..] ...<mailto:jsprnclrtrbrt [..] ...>
> > CC: orocos-users [..] ...<mailto:orocos-users [..] ...>
> >
> >
> >
> >
> > 2011/5/27 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...jsprnclrtrbrt [..] ...>>
> > Dear comrades,
> >
> > I am trying to set the connpolicy of a port from the oro_main, to configure a port to post as a topic in ROS, but i don't know how to proceed. In fact i am trying to emulate the behaveur of a the xml launch file that would be like:
> >
> > <struct name="ROSConDoubleOut" type="ConnPolicy">
> > <simple name="type" type="short"><value>0<value><simple>

> > <simple name="size" type="short"><value>1<value><simple>

> > <simple name="transport" type="short"><value>3<value><simple>

> > <simple name="name_id" type="string"><value>double_orocos_to_ros<value><simple>

> > <struct>
> >
> > <struct name="ControllerTest" type="ControllerTest">
> > <struct name="Activity" type="PeriodicActivity">
> > <simple name="Period" type="double"><value>1<value><simple>
> > <simple name="Priority" type="short"><value>0<value><simple>
> > <simple name="Scheduler" type="string"><value>ORO_SCHED_RT<value><simple>
> > <struct>
> > <simple name="AutoConf" type="boolean"><value>1<value><simple>
> > <simple name="AutoStart" type="boolean"><value>1<value><simple>
> > <struct name="Ports" type="PropertyBag">
> > <simple name="ros_double_out" type="string"><value> ROSConDoubleOut <value><simple>
> > <struct>
> > <simple name="Service" type="string"><value>rosparam<value><simple>
> > <struct>
> >
> > I have an Orocos component, OroComp, with a port named, say:
> > RTT::OutputPort<std::vector > >
> > i have added it in the constructor component with:
> > this->ports()->addPort("myPortName",myPort);
> >
> > and now i have an
> >
> > OroComp TheComp("TheCompName");
> >
> > int ORO_main(int argc, char** argv)
> > {
> > // Orocos ports
> > // Connection policies
> > ConnPolicy connpol(0, 2);
> > connpol.type = 0; // data
> > connpol.size = 1; // buffer size
> > connpol.trasport = 3; // ROS
> > connpol.name_id = "myPortName";
> >
> > You are near the point :
> > connpol.name_id Should have the rostopic in which you want to publish (I don't know if "myPortName" is really the name of your topic)
> > You miss this line : stream("TheCompName.myPortName", connpol);
> >
> > It should work then
> >
> >
> >
> > But after this i don't have any idea on how to proceed, and doing this definitely i don't see the topic in ROS :(. I guess i may have to create a propertybag and add a port as a property, but i am quite lost about it.
> >
> > Has anyone gone through this or knows where i can find information on it?
> >
> > Thx in advance.
> >
> > Josep
> >
> >
> > --
> > Orocos-Users mailing list
> > Orocos-Users [..] ...<mailto:Orocos-Users [..] ...>
> > http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
> >
> >
> >
> >
> >
> >
>

connpolicy in oro_main?

On Tue, 31 May 2011, Josep Arnau Claret Robert wrote:

>
>
>> Date: Tue, 31 May 2011 13:42:44 +0200
>> From: Herman [dot] Bruyninckx [..] ...
>> To: jsprnclrtrbrt [..] ...
>> CC: lambert [dot] willy [..] ...; orocos-users [..] ...; Ruben [dot] Smits [..] ...
>> Subject: Re: [Orocos-users] connpolicy in oro_main?
>>
>> On Tue, 31 May 2011, Josep Arnau Claret Robert wrote:
>>
>>> Hi all,
>>>
>>> the thing is that i have an orocos component that i don't want to change, that is, add to it the ros typekit (the include, and writing/reading the typekit ports), as i want to keep it orocos "pure". But i want to see its attributes, properties and ports from ros, so i decided to construct a mixed ros/orocos node which in oro_main (where all the ros stuff is added: ros while, publishers, etc) initializes the orocos component, so then it is able to ask for its attributes and properties, "linked" to ros services.
>>>
>>> Then i also need to "link" the ports to subscribers/publishers. As my idea is not to change the original orocos component, I though on the mixed ros/orocos node reading and writing the orocos ports and then doing the brigde to the subscribers/publishers of ros.
>>>
>>> maybe i should rethink it all, please id really like to hear ur opinion on this, as I am very new to orocos, and maybe my solution is umm... lets say, silly :P.
>>
>> Personally, I don't think you have another option, given your constraints.
>> (And given that I understand exactly what you mean...)
>>
>> I even think you have the best possible solution, given that the ROS
>> "component model" is less rich than Orocos', in the sense that it does not
>> differentiate between different kind of "ports" (event, data,
>> configuration). So, a one-on-one mapping between both component models is
>> not possible, and compromises have to be made.
>>
>>> Thx in advance.
>>>
>>> Josep
>>
>>> (I decided to choose the oro_main as the base to start the orocos
>>> component and create the input/output ports and all, as it was easy to
>>> mix with the ros main, but if you think its more efficient to use the
>>> deployer component to do that, i might change that also)
>>
>> Define "more efficient"....
>
>
> I am not really sure what efficient may be, in a Orocos context (faster?
> keeps better with the real time?), but in fact i was hopping that u
> orocos guys would know.

Ok :-) I think the major difference is that of flexibility: the use of a
deployment file/script is "late commitment", that is, decisions about the
precise architecture of your system can be delayed (and hence, adapted to
new circumstances).

> The question is: if i have to start a component not from another
> component, and from the cdeployer, but just from another C++ program,
> what would be the best option?

This would imply very strong coupling between these components, so it is
definitely not a good idea. If you have to do it anyway, then it probably
does not matter, since reusability/flexibility are reduced to zero
anyway, because of the strong coupling...

Unless, of course, your "other C++ program" is a "deployment coordinator",
whose job it is to know all the internal details of the deployed system.

> Josep

Herman

>
>>
>> Herman
>>
>>> ________________________________
>>> Date: Mon, 30 May 2011 22:15:34 +0200
>>> Subject: Re: [Orocos-users] connpolicy in oro_main?
>>> From: lambert [dot] willy [..] ...
>>> To: jsprnclrtrbrt [..] ...
>>> CC: orocos-users [..] ...
>>>
>>>
>>>
>>> 2011/5/30 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...jsprnclrtrbrt [..] ...>>
>>> Hi Willy,
>>>
>>> seems that the point is that i need to use a ROS msg, even for a simple bool msg. That means that i have to do the typekit and that the orocos node will have to work also with the ros msg, which i dont want. I want the orocos node to work with a vector of double.
>>>
>>> You have some pre-existing typekit in the orocos_ros_toolchain. You should really use them when possible as it will save your time. I sometimes use ROS types in Orocos component to help ROS integration.
>>> You canuse the port as a vector of double and create a copy of it in a ROS type for ROS (be aware of latency, it depends of the reason why you interface with ROS, debug datas ? displaying ? high frequency datas ?)
>>>
>>>
>>> I found another option which is to connect to the component output ports with input ports in the oro_main, get those values and then publish them to ros with a normal ros publisher. I guess this should work fine.
>>>
>>> I have a question, thought. As i have to connect the input and output ports with
>>>
>>> static bool createConnection(OutputPort<T><http://people.mech.kuleuven.be/%7Eorocos/pub/documentation/rtt/v2.0.x/api/html/classRTT_1_1OutputPort.html>& output_port, base::InputPortInterface<http://people.mech.kuleuven.be/%7Eorocos/pub/documentation/rtt/v2.0.x/api/html/classRTT_1_1base_1_1InputPortInterface.html>& input_port, ConnPolicy<http://people.mech.kuleuven.be/%7Eorocos/pub/documentation/rtt/v2.0.x/api/html/classRTT_1_1ConnPolicy.html> const& policy)
>>>
>>> for each connection -and i have quite a lot of connections-, and all my policies are the same, I was wondering if i have to create one policy per connection or i can just create one and give it to all the createConnection functions (yes, lazy me!).
>>>
>>> As Ruben said, the Ros topic name has to be defined (it's *your* choice as for a port name) so you'll have to type as many lines as topic name you want to create. If you really have many of them you should create some naming rules like portName=topicName (which is again *your choice) and automate this port creation with a createRosPort('portName") function of your own.
>>>
>>>
>>> Besides that, thx for ur help, as it helps me keep going!
>>>
>>> Josep
>>>
>>> ________________________________
>>> Date: Mon, 30 May 2011 18:50:40 +0200
>>>
>>> Subject: Re: [Orocos-users] connpolicy in oro_main?
>>> From: lambert [dot] willy [..] ...<mailto:lambert [dot] willy [..] ...>
>>> To: jsprnclrtrbrt [..] ...<mailto:jsprnclrtrbrt [..] ...>
>>> CC: orocos-users [..] ...<mailto:orocos-users [..] ...>
>>>
>>>
>>>
>>> 2011/5/30 Willy Lambert <lambert [dot] willy [..] ...lambert [dot] willy [..] ...>>
>>>
>>>
>>> 2011/5/30 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...jsprnclrtrbrt [..] ...>>
>>> Hi, Willy
>>>
>>> i do:
>>>
>>> RTT::internal::ConnFactory::createStream(TheCompName.myPort, connpol);
>>>
>>> It compiles ok, but when i execute from ros i get the message:
>>>
>>> 0.214 [ Warning][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()] The protocol with id 3 did not register a fall-back handler for unknown types!
>>> 0.214 [ Warning][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()] triggered by: unknown_t which does not have a transport.
>>> 0.214 [ ERROR ][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()] Could not create transport stream for port msrJntPos with transport id 3
>>> 0.214 [ ERROR ][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnulinux::main()] No such transport registered. Check your policy.transport settings or add the transport for type array
>>>
>>> do you have any idea what i might be doing wrong?
>>>
>>> Here is my sample deployment :
>>>
>>>
>>> require("ros_integration");
>>> var ConnPolicy start;
>>> start.transport = 3; // ROS == 3
>>> start.name_id = "/Protokrot/start"; // ros topic
>>> stream("Protokrot.outIoStart", start);
>>>
>>> It is orocos script syntax, I don't know how to do it in C++
>>>
>>>
>>> Check that the port you are linking to ROS is a "ROS type" (bool, double, ... are not working, but std_msgs::Bool do for instance)
>>>
>>>
>>>
>>> Josep
>>>
>>>
>>> ________________________________
>>> Date: Fri, 27 May 2011 21:49:30 +0200
>>> Subject: Re: [Orocos-users] connpolicy in oro_main?
>>> From: lambert [dot] willy [..] ...<mailto:lambert [dot] willy [..] ...>
>>> To: jsprnclrtrbrt [..] ...<mailto:jsprnclrtrbrt [..] ...>
>>> CC: orocos-users [..] ...<mailto:orocos-users [..] ...>
>>>
>>>
>>>
>>>
>>> 2011/5/27 Josep Arnau Claret Robert <jsprnclrtrbrt [..] ...jsprnclrtrbrt [..] ...>>
>>> Dear comrades,
>>>
>>> I am trying to set the connpolicy of a port from the oro_main, to configure a port to post as a topic in ROS, but i don't know how to proceed. In fact i am trying to emulate the behaveur of a the xml launch file that would be like:
>>>
>>> <struct name="ROSConDoubleOut" type="ConnPolicy">
>>> <simple name="type" type="short"><value>0<value><simple>

>>> <simple name="size" type="short"><value>1<value><simple>

>>> <simple name="transport" type="short"><value>3<value><simple>

>>> <simple name="name_id" type="string"><value>double_orocos_to_ros<value><simple>

>>> <struct>
>>>
>>> <struct name="ControllerTest" type="ControllerTest">
>>> <struct name="Activity" type="PeriodicActivity">
>>> <simple name="Period" type="double"><value>1<value><simple>
>>> <simple name="Priority" type="short"><value>0<value><simple>
>>> <simple name="Scheduler" type="string"><value>ORO_SCHED_RT<value><simple>
>>> <struct>
>>> <simple name="AutoConf" type="boolean"><value>1<value><simple>
>>> <simple name="AutoStart" type="boolean"><value>1<value><simple>
>>> <struct name="Ports" type="PropertyBag">
>>> <simple name="ros_double_out" type="string"><value> ROSConDoubleOut <value><simple>
>>> <struct>
>>> <simple name="Service" type="string"><value>rosparam<value><simple>
>>> <struct>
>>>
>>> I have an Orocos component, OroComp, with a port named, say:
>>> RTT::OutputPort<std::vector >>>
>>> i have added it in the constructor component with:
>>> this->ports()->addPort("myPortName",myPort);
>>>
>>> and now i have an
>>>
>>> OroComp TheComp("TheCompName");
>>>
>>> int ORO_main(int argc, char** argv)
>>> {
>>> // Orocos ports
>>> // Connection policies
>>> ConnPolicy connpol(0, 2);
>>> connpol.type = 0; // data
>>> connpol.size = 1; // buffer size
>>> connpol.trasport = 3; // ROS
>>> connpol.name_id = "myPortName";
>>>
>>> You are near the point :
>>> connpol.name_id Should have the rostopic in which you want to publish (I don't know if "myPortName" is really the name of your topic)
>>> You miss this line : stream("TheCompName.myPortName", connpol);
>>>
>>> It should work then
>>>
>>> But after this i don't have any idea on how to proceed, and doing this definitely i don't see the topic in ROS :(. I guess i may have to create a propertybag and add a port as a property, but i am quite lost about it.
>>>
>>> Has anyone gone through this or knows where i can find information on it?
>>>
>>> Thx in advance.
>>>
>>> Josep
>>>
>>>
>>> --
>>> Orocos-Users mailing list
>>> Orocos-Users [..] ...<mailto:Orocos-Users [..] ...>
>>> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>>>
>>>
>>>
>>>
>>>
>>>
>>
>> --
>> --
>> K.U.Leuven, Mechanical Eng., Mechatronics & Robotics Research Group
>> <http://people.mech.kuleuven.be/~bruyninc> Tel: +32 16 328056
>> EURON Coordinator (European Robotics Research Network) <http://www.euron.org>
>> Open Realtime Control Services <http://www.orocos.org>
>> Associate Editor JOSER <http://www.joser.org>, IJRR <http://www.ijrr.org>
>

connpolicy in oro_main?

On May 31, 2011, at 08:07 , Herman Bruyninckx wrote:

> On Tue, 31 May 2011, Josep Arnau Claret Robert wrote:
>
>>
>>
>>> Date: Tue, 31 May 2011 13:42:44 +0200
>>> From: Herman [dot] Bruyninckx [..] ...
>>> To: jsprnclrtrbrt [..] ...
>>> CC: lambert [dot] willy [..] ...; orocos-users [..] ...; Ruben [dot] Smits [..] ...
>>> Subject: Re: [Orocos-users] connpolicy in oro_main?
>>>
>>> On Tue, 31 May 2011, Josep Arnau Claret Robert wrote:
>>>
>>>> Hi all,
>>>>
>>>> the thing is that i have an orocos component that i don't want to change, that is, add to it the ros typekit (the include, and writing/reading the typekit ports), as i want to keep it orocos "pure". But i want to see its attributes, properties and ports from ros, so i decided to construct a mixed ros/orocos node which in oro_main (where all the ros stuff is added: ros while, publishers, etc) initializes the orocos component, so then it is able to ask for its attributes and properties, "linked" to ros services.
>>>>
>>>> Then i also need to "link" the ports to subscribers/publishers. As my idea is not to change the original orocos component, I though on the mixed ros/orocos node reading and writing the orocos ports and then doing the brigde to the subscribers/publishers of ros.
>>>>
>>>> maybe i should rethink it all, please id really like to hear ur opinion on this, as I am very new to orocos, and maybe my solution is umm... lets say, silly :P.
>>>
>>> Personally, I don't think you have another option, given your constraints.
>>> (And given that I understand exactly what you mean...)
>>>
>>> I even think you have the best possible solution, given that the ROS
>>> "component model" is less rich than Orocos', in the sense that it does not
>>> differentiate between different kind of "ports" (event, data,
>>> configuration). So, a one-on-one mapping between both component models is
>>> not possible, and compromises have to be made.
>>>
>>>> Thx in advance.
>>>>
>>>> Josep
>>>
>>>> (I decided to choose the oro_main as the base to start the orocos
>>>> component and create the input/output ports and all, as it was easy to
>>>> mix with the ros main, but if you think its more efficient to use the
>>>> deployer component to do that, i might change that also)
>>>
>>> Define "more efficient"....
>>
>>
>> I am not really sure what efficient may be, in a Orocos context (faster?
>> keeps better with the real time?), but in fact i was hopping that u
>> orocos guys would know.
>
> Ok :-) I think the major difference is that of flexibility: the use of a
> deployment file/script is "late commitment", that is, decisions about the
> precise architecture of your system can be delayed (and hence, adapted to
> new circumstances).
>
>> The question is: if i have to start a component not from another
>> component, and from the cdeployer, but just from another C++ program,
>> what would be the best option?
>
> This would imply very strong coupling between these components, so it is
> definitely not a good idea. If you have to do it anyway, then it probably
> does not matter, since reusability/flexibility are reduced to zero
> anyway, because of the strong coupling...
>
> Unless, of course, your "other C++ program" is a "deployment coordinator",
> whose job it is to know all the internal details of the deployed system.

Herman's points are valid, but he's also right in that sometimes you just have to do things a certain way. Decoupling and good design be damned.

Why not embed an OCL/DeploymentComponent directly into your other component, and use it to do the actual deployment work? We've done similar in the past ... and in all reality, even just creating and connecting a fairly simple component in C++ isn't that difficult, it's just more typing than you'd like (we do this all the time for component unit test cases - and yes, there are better ways ...)
S

connpolicy in oro_main?

> Subject: Re: [Orocos-users] connpolicy in oro_main?
> From: kiwi [dot] net [..] ...
> Date: Tue, 31 May 2011 08:11:19 -0400
> CC: jsprnclrtrbrt [..] ...; orocos-users [..] ...
> To: herman [dot] bruyninckx [..] ...
>
> On May 31, 2011, at 08:07 , Herman Bruyninckx wrote:
>
> > On Tue, 31 May 2011, Josep Arnau Claret Robert wrote:
> >
> >>
> >>
> >>> Date: Tue, 31 May 2011 13:42:44 +0200
> >>> From: Herman [dot] Bruyninckx [..] ...
> >>> To: jsprnclrtrbrt [..] ...
> >>> CC: lambert [dot] willy [..] ...; orocos-users [..] ...; Ruben [dot] Smits [..] ...
> >>> Subject: Re: [Orocos-users] connpolicy in oro_main?
> >>>
> >>> On Tue, 31 May 2011, Josep Arnau Claret Robert wrote:
> >>>
> >>>> Hi all,
> >>>>
> >>>> the thing is that i have an orocos component that i don't want to change, that is, add to it the ros typekit (the include, and writing/reading the typekit ports), as i want to keep it orocos "pure". But i want to see its attributes, properties and ports from ros, so i decided to construct a mixed ros/orocos node which in oro_main (where all the ros stuff is added: ros while, publishers, etc) initializes the orocos component, so then it is able to ask for its attributes and properties, "linked" to ros services.
> >>>>
> >>>> Then i also need to "link" the ports to subscribers/publishers. As my idea is not to change the original orocos component, I though on the mixed ros/orocos node reading and writing the orocos ports and then doing the brigde to the subscribers/publishers of ros.
> >>>>
> >>>> maybe i should rethink it all, please id really like to hear ur opinion on this, as I am very new to orocos, and maybe my solution is umm... lets say, silly :P.
> >>>
> >>> Personally, I don't think you have another option, given your constraints.
> >>> (And given that I understand exactly what you mean...)
> >>>
> >>> I even think you have the best possible solution, given that the ROS
> >>> "component model" is less rich than Orocos', in the sense that it does not
> >>> differentiate between different kind of "ports" (event, data,
> >>> configuration). So, a one-on-one mapping between both component models is
> >>> not possible, and compromises have to be made.
> >>>
> >>>> Thx in advance.
> >>>>
> >>>> Josep
> >>>
> >>>> (I decided to choose the oro_main as the base to start the orocos
> >>>> component and create the input/output ports and all, as it was easy to
> >>>> mix with the ros main, but if you think its more efficient to use the
> >>>> deployer component to do that, i might change that also)
> >>>
> >>> Define "more efficient"....
> >>
> >>
> >> I am not really sure what efficient may be, in a Orocos context (faster?
> >> keeps better with the real time?), but in fact i was hopping that u
> >> orocos guys would know.
> >
> > Ok :-) I think the major difference is that of flexibility: the use of a
> > deployment file/script is "late commitment", that is, decisions about the
> > precise architecture of your system can be delayed (and hence, adapted to
> > new circumstances).
> >
> >> The question is: if i have to start a component not from another
> >> component, and from the cdeployer, but just from another C++ program,
> >> what would be the best option?
> >
> > This would imply very strong coupling between these components, so it is
> > definitely not a good idea. If you have to do it anyway, then it probably
> > does not matter, since reusability/flexibility are reduced to zero
> > anyway, because of the strong coupling...
> >
> > Unless, of course, your "other C++ program" is a "deployment coordinator",
> > whose job it is to know all the internal details of the deployed system.
>
> Herman's points are valid, but he's also right in that sometimes you just have to do things a certain way. Decoupling and good design be damned.
>
> Why not embed an OCL/DeploymentComponent directly into your other component, and use it to do the actual deployment work? We've done similar in the past ... and in all reality, even just creating and connecting a fairly simple component in C++ isn't that difficult, it's just more typing than you'd like (we do this all the time for component unit test cases - and yes, there are better ways ...)

You mean create a deployer component in my C++ main function, and with the help of this deployer start the original orocos component, right? But is there a tutorial or some resource where i can get a feeling on how to call the deployer this way?

Josep

> S
>

connpolicy in oro_main?

On May 31, 2011, at 11:39 , Josep Arnau Claret Robert wrote:

>
>
> > Subject: Re: [Orocos-users] connpolicy in oro_main?
> > From: kiwi [dot] net [..] ...
> > Date: Tue, 31 May 2011 08:11:19 -0400
> > CC: jsprnclrtrbrt [..] ...; orocos-users [..] ...
> > To: herman [dot] bruyninckx [..] ...
> >
> > On May 31, 2011, at 08:07 , Herman Bruyninckx wrote:
> >
> > > On Tue, 31 May 2011, Josep Arnau Claret Robert wrote:
> > >
> > >>
> > >>
> > >>> Date: Tue, 31 May 2011 13:42:44 +0200
> > >>> From: Herman [dot] Bruyninckx [..] ...
> > >>> To: jsprnclrtrbrt [..] ...
> > >>> CC: lambert [dot] willy [..] ...; orocos-users [..] ...; Ruben [dot] Smits [..] ...
> > >>> Subject: Re: [Orocos-users] connpolicy in oro_main?
> > >>>
> > >>> On Tue, 31 May 2011, Josep Arnau Claret Robert wrote:
> > >>>
> > >>>> Hi all,
> > >>>>
> > >>>> the thing is that i have an orocos component that i don't want to change, that is, add to it the ros typekit (the include, and writing/reading the typekit ports), as i want to keep it orocos "pure". But i want to see its attributes, properties and ports from ros, so i decided to construct a mixed ros/orocos node which in oro_main (where all the ros stuff is added: ros while, publishers, etc) initializes the orocos component, so then it is able to ask for its attributes and properties, "linked" to ros services.
> > >>>>
> > >>>> Then i also need to "link" the ports to subscribers/publishers. As my idea is not to change the original orocos component, I though on the mixed ros/orocos node reading and writing the orocos ports and then doing the brigde to the subscribers/publishers of ros.
> > >>>>
> > >>>> maybe i should rethink it all, please id really like to hear ur opinion on this, as I am very new to orocos, and maybe my solution is umm... lets say, silly :P.
> > >>>
> > >>> Personally, I don't think you have another option, given your constraints.
> > >>> (And given that I understand exactly what you mean...)
> > >>>
> > >>> I even think you have the best possible solution, given that the ROS
> > >>> "component model" is less rich than Orocos', in the sense that it does not
> > >>> differentiate between different kind of "ports" (event, data,
> > >>> configuration). So, a one-on-one mapping between both component models is
> > >>> not possible, and compromises have to be made.
> > >>>
> > >>>> Thx in advance.
> > >>>>
> > >>>> Josep
> > >>>
> > >>>> (I decided to choose the oro_main as the base to start the orocos
> > >>>> component and create the input/output ports and all, as it was easy to
> > >>>> mix with the ros main, but if you think its more efficient to use the
> > >>>> deployer component to do that, i might change that also)
> > >>>
> > >>> Define "more efficient"....
> > >>
> > >>
> > >> I am not really sure what efficient may be, in a Orocos context (faster?
> > >> keeps better with the real time?), but in fact i was hopping that u
> > >> orocos guys would know.
> > >
> > > Ok :-) I think the major difference is that of flexibility: the use of a
> > > deployment file/script is "late commitment", that is, decisions about the
> > > precise architecture of your system can be delayed (and hence, adapted to
> > > new circumstances).
> > >
> > >> The question is: if i have to start a component not from another
> > >> component, and from the cdeployer, but just from another C++ program,
> > >> what would be the best option?
> > >
> > > This would imply very strong coupling between these components, so it is
> > > definitely not a good idea. If you have to do it anyway, then it probably
> > > does not matter, since reusability/flexibility are reduced to zero
> > > anyway, because of the strong coupling...
> > >
> > > Unless, of course, your "other C++ program" is a "deployment coordinator",
> > > whose job it is to know all the internal details of the deployed system.
> >
> > Herman's points are valid, but he's also right in that sometimes you just have to do things a certain way. Decoupling and good design be damned.
> >
> > Why not embed an OCL/DeploymentComponent directly into your other component, and use it to do the actual deployment work? We've done similar in the past ... and in all reality, even just creating and connecting a fairly simple component in C++ isn't that difficult, it's just more typing than you'd like (we do this all the time for component unit test cases - and yes, there are better ways ...)
>
>
> You mean create a deployer component in my C++ main function, and with the help of this deployer start the original orocos component, right? But is there a tutorial or some resource where i can get a feeling on how to call the deployer this way?

No tutorial as this is an unusual method. See the source for the OCL deployer in bin/deployer.cpp.
S

Ruben Smits's picture

connpolicy in oro_main?

On Monday 30 May 2011 19:28:32 Josep Arnau Claret Robert wrote:
> Hi Willy,
>
> seems that the point is that i need to use a ROS msg, even for a simple bool
> msg. That means that i have to do the typekit and that the orocos node will
> have to work also with the ros msg, which i dont want. I want the orocos
> node to work with a vector of double.

What is the main reason to not use ROS-msgs? They don't really add a lot of
overhead on top an std::vector<double>

> I found another option which is to connect to the component output ports
> with input ports in the oro_main, get those values and then publish them to
> ros with a normal ros publisher. I guess this should work fine.

I usually never touch the oro_main and always use the ocl/deployer or
ocl/rttlua but I hope you realize that you will have to constantly poll the
input ports to check whether new data is available, convert them into ros msgs
and then publish them. This is exactly what the orocos_ros_integration plugin
is doing for you in a generic way. You will probably face quite some
challenges implementing this without compromising the realtime behavior of
your system. This is all extra work you would not have to do by just
considering the use of a ROS msg datatype.

> I have a question, thought. As i have to connect the input and output ports
> with
>
> static bool
> createConnection(OutputPort<T><http://people.mech.kuleuven.be/%7Eorocos/pub
> /documentation/rtt/v2.0.x/api/html/classRTT_1_1OutputPort.html>&
> output_port,
> base::InputPortInterface<http://people.mech.kuleuven.be/%7Eorocos/pub/docum
> entation/rtt/v2.0.x/api/html/classRTT_1_1base_1_1InputPortInterface.html>&
> input_port,
> ConnPolicy<http://people.mech.kuleuven.be/%7Eorocos/pub/documentation/rtt/v
> 2.0.x/api/html/classRTT_1_1ConnPolicy.html> const& policy)
>
> for each connection -and i have quite a lot of connections-, and all my
> policies are the same, I was wondering if i have to create one policy per
> connection or i can just create one and give it to all the createConnection
> functions (yes, lazy me!).

You can reuse the connection policy, but you will at least have the change the
name_id for every new connection if you are using the ROS stream.

>
> Besides that, thx for ur help, as it helps me keep going!
>
> Josep

-- Ruben

> ________________________________
> Date: Mon, 30 May 2011 18:50:40 +0200
> Subject: Re: [Orocos-users] connpolicy in oro_main?
> From: lambert [dot] willy [..] ...
> To: jsprnclrtrbrt [..] ...
> CC: orocos-users [..] ...
>
>
>
> 2011/5/30 Willy Lambert
> <lambert [dot] willy [..] ...lambert [dot] willy [..] ...>>
>
>
> 2011/5/30 Josep Arnau Claret Robert
> <jsprnclrtrbrt [..] ...jsprnclrtrbrt [..] ...>> Hi, Willy
>
> i do:
>
> RTT::internal::ConnFactory::createStream(TheCompName.myPort, connpol);
>
> It compiles ok, but when i execute from ros i get the message:
>
> 0.214 [
> Warning][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compk
> g-gnulinux::main()] The protocol with id 3 did not register a fall-back
> handler for unknown types! 0.214 [
> Warning][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compk
> g-gnulinux::main()] triggered by: unknown_t which does not have a
> transport. 0.214 [ ERROR
> ][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnuli
> nux::main()] Could not create transport stream for port msrJntPos with
> transport id 3 0.214 [ ERROR
> ][/home/users/josep.a.claret/ros-orocos_pkgs/ros/iocros/compkg/compkg-gnuli
> nux::main()] No such transport registered. Check your policy.transport
> settings or add the transport for type array
>
> do you have any idea what i might be doing wrong?
>
> Here is my sample deployment :
>
>
> require("ros_integration");
> var ConnPolicy start;
> start.transport = 3; // ROS == 3
> start.name_id = "/Protokrot/start"; // ros topic
> stream("Protokrot.outIoStart", start);
>
> It is orocos script syntax, I don't know how to do it in C++
>
>
> Check that the port you are linking to ROS is a "ROS type" (bool, double,
> ... are not working, but std_msgs::Bool do for instance)
>
>
>
> Josep
>
>
> ________________________________
> Date: Fri, 27 May 2011 21:49:30 +0200
> Subject: Re: [Orocos-users] connpolicy in oro_main?
> From: lambert [dot] willy [..] ...<mailto:lambert [dot] willy [..] ...>
> To: jsprnclrtrbrt [..] ...<mailto:jsprnclrtrbrt [..] ...>
> CC:
> orocos-users [..] ...<mailto:orocos-users [..] ...en
> .be>
>
>
>
>
> 2011/5/27 Josep Arnau Claret Robert
> <jsprnclrtrbrt [..] ...jsprnclrtrbrt [..] ...>> Dear
> comrades,
>
> I am trying to set the connpolicy of a port from the oro_main, to configure
> a port to post as a topic in ROS, but i don't know how to proceed. In fact
> i am trying to emulate the behaveur of a the xml launch file that would be
> like:
>
> <struct name="ROSConDoubleOut" type="ConnPolicy">
> <simple name="type" type="short"><value>0<value><simple>&lt;!-- type of
&gt; connection: 0 means Data --> <simple name="size"
> type="short"><value>1<value><simple>

<simple
> name="transport" type="short"><value>3<value><simple>

> <simple name="name_id"
> type="string"><value>double_orocos_to_ros<value><simple>&lt;!-- topic name
&gt; --> <struct>
>
> <struct name="ControllerTest" type="ControllerTest">
> <struct name="Activity" type="PeriodicActivity">
> <simple name="Period" type="double"><value>1<value><simple>
> <simple name="Priority" type="short"><value>0<value><simple>
> <simple name="Scheduler"
> type="string"><value>ORO_SCHED_RT<value><simple> <struct>
> <simple name="AutoConf" type="boolean"><value>1<value><simple>
> <simple name="AutoStart" type="boolean"><value>1<value><simple>
> <struct name="Ports" type="PropertyBag">
> <simple name="ros_double_out" type="string"><value> ROSConDoubleOut
> <value><simple> <struct>
> <simple name="Service" type="string"><value>rosparam<value><simple>
> <struct>
>
> I have an Orocos component, OroComp, with a port named, say:
> RTT::OutputPort<std::vector >
> i have added it in the constructor component with:
> this->ports()->addPort("myPortName",myPort);
>
> and now i have an
>
> OroComp TheComp("TheCompName");
>
> int ORO_main(int argc, char** argv)
> {
> // Orocos ports
> // Connection policies
> ConnPolicy connpol(0, 2);
> connpol.type = 0; // data
> connpol.size = 1; // buffer size
> connpol.trasport = 3; // ROS
> connpol.name_id = "myPortName";
>
> You are near the point :
> connpol.name_id Should have the rostopic in which you want to publish (I
> don't know if "myPortName" is really the name of your topic) You miss this
> line : stream("TheCompName.myPortName", connpol);
>
> It should work then
>
>
>
> But after this i don't have any idea on how to proceed, and doing this
> definitely i don't see the topic in ROS :(. I guess i may have to create a
> propertybag and add a port as a property, but i am quite lost about it.
>
> Has anyone gone through this or knows where i can find information on it?
>
> Thx in advance.
>
> Josep
>
>
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...<mailto:Orocos-Users [..] ...en.
> be> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users