Reading port returns NoData when expected OldData

Hi all,

I have 2 components A and B. They are connected via a port P of type
std::vector<double>. It is an outputport in component A, and an
inputport in component B.

In component A, I write to the port in startHook, and then write to it
sporadically.

Component B is being triggered by an other port, but when it is
triggered, it should read port P. It doesn't matter if the data on port
P is old or new.

Now what is happening that the read-command returns NoData, where I
would expect it to return OldData. I checked in the deployer the value
of port P in component A, and there really is a value on the port.

Any idea why NoData is returned?

Best,
Kurt

Reading port returns NoData when expected OldData

On Wed, May 16, 2012 at 2:51 PM, Kurt Geebelen
<kurt [dot] geebelen [..] ...> wrote:
> Hi all,
>
> I have 2 components A and B. They are connected via a port P of type
> std::vector<double>. It is an outputport in component A, and an
> inputport in component B.
>
> In component A, I write to the port in startHook, and then write to it
> sporadically.
>
> Component B is being triggered by an other port, but when it is
> triggered, it should read port P. It doesn't matter if the data on port
> P is old or new.
>
> Now what is happening that the read-command returns NoData, where I
> would expect it to return OldData. I checked in the deployer the value
> of port P in component A, and there really is a value on the port.
>
> Any idea why NoData is returned?

You could check the port connections by loading the rtt_dot_service
Service in the deployer component and read the file with xdot (ros).

Did it ever return NewData ?

Peter

Reading port returns NoData when expected OldData

2012/5/16 Peter Soetens <peter [..] ...>

> On Wed, May 16, 2012 at 2:51 PM, Kurt Geebelen
> <kurt [dot] geebelen [..] ...> wrote:
> > Hi all,
> >
> > I have 2 components A and B. They are connected via a port P of type
> > std::vector<double>. It is an outputport in component A, and an
> > inputport in component B.
> >
> > In component A, I write to the port in startHook, and then write to it
> > sporadically.
> >
> > Component B is being triggered by an other port, but when it is
> > triggered, it should read port P. It doesn't matter if the data on port
> > P is old or new.
> >
> > Now what is happening that the read-command returns NoData, where I
> > would expect it to return OldData. I checked in the deployer the value
> > of port P in component A, and there really is a value on the port.
> >
> > Any idea why NoData is returned?
>

Maybe you could send us at least your deployment script?

Charles.

Reading port returns NoData when expected OldData

Op 16/05/2012 17:24, Charles Lesire-Cabaniols schreef:
>
>
> 2012/5/16 Peter Soetens <peter [..] ...
> <mailto:peter [..] ...>>
>
> On Wed, May 16, 2012 at 2:51 PM, Kurt Geebelen
> <kurt [dot] geebelen [..] ...
> <mailto:kurt [dot] geebelen [..] ...>> wrote:
> > Hi all,
> >
> > I have 2 components A and B. They are connected via a port P of type
> > std::vector<double>. It is an outputport in component A, and an
> > inputport in component B.
> >
> > In component A, I write to the port in startHook, and then write
> to it
> > sporadically.
> >
> > Component B is being triggered by an other port, but when it is
> > triggered, it should read port P. It doesn't matter if the data
> on port
> > P is old or new.
> >
> > Now what is happening that the read-command returns NoData, where I
> > would expect it to return OldData. I checked in the deployer the
> value
> > of port P in component A, and there really is a value on the port.
> >
> > Any idea why NoData is returned?
>
>
> Maybe you could send us at least your deployment script?
Deployment script is on attachment. The connection that is giving
problems is on line 101:
connect("dynamicMHE.portMeasurementsCtrl","mcuHandler.controlOutputPort",cp)
(mcuHandler is the component which outputs, dynamicMHE takes the input.
None of the other components use mcuHandler.controlOutputPort)

But I found a way in which I don't have the problem: if I start
mcuHandler at the end of the script, e.g. on line 91, in stead of in the
beginning (now on line 23) I do get OldData from the port, and not NoData.

This thus solves my problem, but I find it weird why this happens..

>
> Charles.

Kurt

Ruben Smits's picture

Reading port returns NoData when expected OldData

On Wed, May 16, 2012 at 5:30 PM, Kurt Geebelen
<kurt [dot] geebelen [..] ...> wrote:
>
>
> Op 16/05/2012 17:24, Charles Lesire-Cabaniols schreef:
>
>
>
> 2012/5/16 Peter Soetens <peter [..] ...>
>>
>> On Wed, May 16, 2012 at 2:51 PM, Kurt Geebelen
>> <kurt [dot] geebelen [..] ...> wrote:
>> > Hi all,
>> >
>> > I have 2 components A and B. They are connected via a port P of type
>> > std::vector<double>. It is an outputport in component A, and an
>> > inputport in component B.
>> >
>> > In component A, I write to the port in startHook, and then write to it
>> > sporadically.
>> >
>> > Component B is being triggered by an other port, but when it is
>> > triggered, it should read port P. It doesn't matter if the data on port
>> > P is old or new.
>> >
>> > Now what is happening that the read-command returns NoData, where I
>> > would expect it to return OldData. I checked in the deployer the value
>> > of port P in component A, and there really is a value on the port.
>> >
>> > Any idea why NoData is returned?
>
>
> Maybe you could send us at least your deployment script?
>
> Deployment script is on attachment. The connection that is giving problems
> is on line 101:
> connect("dynamicMHE.portMeasurementsCtrl","mcuHandler.controlOutputPort",cp)
> (mcuHandler is the component which outputs, dynamicMHE takes the input. None
> of the other components use mcuHandler.controlOutputPort)
>
> But I found a way in which I don't have the problem: if I start mcuHandler
> at the end of the script, e.g. on line 91, in stead of in the beginning (now
> on line 23) I do get OldData from the port, and not NoData.
>
> This thus solves my problem, but I find it weird why this happens..
>

It seems completely normal to me, since you create the connection
after the write (which happens in your startHook). The data never
arrived in the receiving component.

Ruben

>
> Charles.
>
>
> Kurt
>
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>

Reading port returns NoData when expected OldData

Op 16/05/2012 18:28, Ruben Smits schreef:
> On Wed, May 16, 2012 at 5:30 PM, Kurt Geebelen
> <kurt [dot] geebelen [..] ...> wrote:
>>
>> Op 16/05/2012 17:24, Charles Lesire-Cabaniols schreef:
>>
>>
>>
>> 2012/5/16 Peter Soetens<peter [..] ...>
>>> On Wed, May 16, 2012 at 2:51 PM, Kurt Geebelen
>>> <kurt [dot] geebelen [..] ...> wrote:
>>>> Hi all,
>>>>
>>>> I have 2 components A and B. They are connected via a port P of type
>>>> std::vector<double>. It is an outputport in component A, and an
>>>> inputport in component B.
>>>>
>>>> In component A, I write to the port in startHook, and then write to it
>>>> sporadically.
>>>>
>>>> Component B is being triggered by an other port, but when it is
>>>> triggered, it should read port P. It doesn't matter if the data on port
>>>> P is old or new.
>>>>
>>>> Now what is happening that the read-command returns NoData, where I
>>>> would expect it to return OldData. I checked in the deployer the value
>>>> of port P in component A, and there really is a value on the port.
>>>>
>>>> Any idea why NoData is returned?
>>
>> Maybe you could send us at least your deployment script?
>>
>> Deployment script is on attachment. The connection that is giving problems
>> is on line 101:
>> connect("dynamicMHE.portMeasurementsCtrl","mcuHandler.controlOutputPort",cp)
>> (mcuHandler is the component which outputs, dynamicMHE takes the input. None
>> of the other components use mcuHandler.controlOutputPort)
>>
>> But I found a way in which I don't have the problem: if I start mcuHandler
>> at the end of the script, e.g. on line 91, in stead of in the beginning (now
>> on line 23) I do get OldData from the port, and not NoData.
>>
>> This thus solves my problem, but I find it weird why this happens..
>>
> It seems completely normal to me, since you create the connection
> after the write (which happens in your startHook). The data never
> arrived in the receiving component.
Ah, ok, I see.

Thanks,
Kurt

>
> Ruben
>
>> Charles.
>>
>>
>> Kurt
>>
>> --
>> Orocos-Users mailing list
>> Orocos-Users [..] ...
>> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>>
>
>

Reading port returns NoData when expected OldData

On Wed, 16 May 2012, Kurt Geebelen wrote:

>
>
> Op 16/05/2012 18:28, Ruben Smits schreef:
>> On Wed, May 16, 2012 at 5:30 PM, Kurt Geebelen
>> <kurt [dot] geebelen [..] ...> wrote:
>>>
>>> Op 16/05/2012 17:24, Charles Lesire-Cabaniols schreef:
>>>
>>>
>>>
>>> 2012/5/16 Peter Soetens<peter [..] ...>
>>>> On Wed, May 16, 2012 at 2:51 PM, Kurt Geebelen
>>>> <kurt [dot] geebelen [..] ...> wrote:
>>>>> Hi all,
>>>>>
>>>>> I have 2 components A and B. They are connected via a port P of type
>>>>> std::vector<double>. It is an outputport in component A, and an
>>>>> inputport in component B.
>>>>>
>>>>> In component A, I write to the port in startHook, and then write to it
>>>>> sporadically.
>>>>>
>>>>> Component B is being triggered by an other port, but when it is
>>>>> triggered, it should read port P. It doesn't matter if the data on port
>>>>> P is old or new.
>>>>>
>>>>> Now what is happening that the read-command returns NoData, where I
>>>>> would expect it to return OldData. I checked in the deployer the value
>>>>> of port P in component A, and there really is a value on the port.
>>>>>
>>>>> Any idea why NoData is returned?
>>>
>>> Maybe you could send us at least your deployment script?
>>>
>>> Deployment script is on attachment. The connection that is giving problems
>>> is on line 101:
>>> connect("dynamicMHE.portMeasurementsCtrl","mcuHandler.controlOutputPort",cp)
>>> (mcuHandler is the component which outputs, dynamicMHE takes the input. None
>>> of the other components use mcuHandler.controlOutputPort)
>>>
>>> But I found a way in which I don't have the problem: if I start mcuHandler
>>> at the end of the script, e.g. on line 91, in stead of in the beginning (now
>>> on line 23) I do get OldData from the port, and not NoData.
>>>
>>> This thus solves my problem, but I find it weird why this happens..
>>>
>> It seems completely normal to me, since you create the connection
>> after the write (which happens in your startHook). The data never
>> arrived in the receiving component.
> Ah, ok, I see.
>
> Thanks,
> Kurt

A piece of advice: separate deployment from runtime use. I mean: use the
deployment script to get all your components up, but not yet running. Once
they are all ready, only then you let your coordinator send out a run event
after which data can begin to flow.

This is the logic of having (at least) four separate phases in the
"development process":
- component development
- system building
- deployment
- runtime
Threat them differently, and don't use files or scripts that mix two of
them.

>> Ruben
>>> Charles.
>>> Kurt

Herman

Reading port returns NoData when expected OldData

Op 17/05/2012 12:15, Herman Bruyninckx schreef:
> On Wed, 16 May 2012, Kurt Geebelen wrote:
>
>>
>>
>> Op 16/05/2012 18:28, Ruben Smits schreef:
>>> On Wed, May 16, 2012 at 5:30 PM, Kurt Geebelen
>>> <kurt [dot] geebelen [..] ...> wrote:
>>>>
>>>> Op 16/05/2012 17:24, Charles Lesire-Cabaniols schreef:
>>>>
>>>>
>>>>
>>>> 2012/5/16 Peter Soetens<peter [..] ...>
>>>>> On Wed, May 16, 2012 at 2:51 PM, Kurt Geebelen
>>>>> <kurt [dot] geebelen [..] ...> wrote:
>>>>>> Hi all,
>>>>>>
>>>>>> I have 2 components A and B. They are connected via a port P of type
>>>>>> std::vector<double>. It is an outputport in component A, and an
>>>>>> inputport in component B.
>>>>>>
>>>>>> In component A, I write to the port in startHook, and then write
>>>>>> to it
>>>>>> sporadically.
>>>>>>
>>>>>> Component B is being triggered by an other port, but when it is
>>>>>> triggered, it should read port P. It doesn't matter if the data
>>>>>> on port
>>>>>> P is old or new.
>>>>>>
>>>>>> Now what is happening that the read-command returns NoData, where I
>>>>>> would expect it to return OldData. I checked in the deployer the
>>>>>> value
>>>>>> of port P in component A, and there really is a value on the port.
>>>>>>
>>>>>> Any idea why NoData is returned?
>>>>
>>>> Maybe you could send us at least your deployment script?
>>>>
>>>> Deployment script is on attachment. The connection that is giving
>>>> problems
>>>> is on line 101:
>>>> connect("dynamicMHE.portMeasurementsCtrl","mcuHandler.controlOutputPort",cp)
>>>>
>>>> (mcuHandler is the component which outputs, dynamicMHE takes the
>>>> input. None
>>>> of the other components use mcuHandler.controlOutputPort)
>>>>
>>>> But I found a way in which I don't have the problem: if I start
>>>> mcuHandler
>>>> at the end of the script, e.g. on line 91, in stead of in the
>>>> beginning (now
>>>> on line 23) I do get OldData from the port, and not NoData.
>>>>
>>>> This thus solves my problem, but I find it weird why this happens..
>>>>
>>> It seems completely normal to me, since you create the connection
>>> after the write (which happens in your startHook). The data never
>>> arrived in the receiving component.
>> Ah, ok, I see.
>>
>> Thanks,
>> Kurt
>
> A piece of advice: separate deployment from runtime use. I mean: use the
> deployment script to get all your components up, but not yet running.
> Once
> they are all ready, only then you let your coordinator send out a run
> event
> after which data can begin to flow.
>
> This is the logic of having (at least) four separate phases in the
> "development process":
> - component development
> - system building
> - deployment
> - runtime
> Threat them differently, and don't use files or scripts that mix two of
> them.

That's exactly what we did yesterday after discovering the behavior :-) .

>
>>> Ruben
>>>> Charles.
>>>> Kurt
>
> Herman
Kurt

Reading port returns NoData when expected OldData

On Thu, 17 May 2012, Kurt Geebelen wrote:

>
>
> Op 17/05/2012 12:15, Herman Bruyninckx schreef:
>> On Wed, 16 May 2012, Kurt Geebelen wrote:
>>
>>>
>>>
>>> Op 16/05/2012 18:28, Ruben Smits schreef:
>>>> On Wed, May 16, 2012 at 5:30 PM, Kurt Geebelen
>>>> <kurt [dot] geebelen [..] ...> wrote:
>>>>>
>>>>> Op 16/05/2012 17:24, Charles Lesire-Cabaniols schreef:
>>>>>
>>>>>
>>>>>
>>>>> 2012/5/16 Peter Soetens<peter [..] ...>
>>>>>> On Wed, May 16, 2012 at 2:51 PM, Kurt Geebelen
>>>>>> <kurt [dot] geebelen [..] ...> wrote:
>>>>>>> Hi all,
>>>>>>>
>>>>>>> I have 2 components A and B. They are connected via a port P of type
>>>>>>> std::vector<double>. It is an outputport in component A, and an
>>>>>>> inputport in component B.
>>>>>>>
>>>>>>> In component A, I write to the port in startHook, and then write to it
>>>>>>> sporadically.
>>>>>>>
>>>>>>> Component B is being triggered by an other port, but when it is
>>>>>>> triggered, it should read port P. It doesn't matter if the data on
>>>>>>> port
>>>>>>> P is old or new.
>>>>>>>
>>>>>>> Now what is happening that the read-command returns NoData, where I
>>>>>>> would expect it to return OldData. I checked in the deployer the value
>>>>>>> of port P in component A, and there really is a value on the port.
>>>>>>>
>>>>>>> Any idea why NoData is returned?
>>>>>
>>>>> Maybe you could send us at least your deployment script?
>>>>>
>>>>> Deployment script is on attachment. The connection that is giving
>>>>> problems
>>>>> is on line 101:
>>>>> connect("dynamicMHE.portMeasurementsCtrl","mcuHandler.controlOutputPort",cp)
>>>>> (mcuHandler is the component which outputs, dynamicMHE takes the input.
>>>>> None
>>>>> of the other components use mcuHandler.controlOutputPort)
>>>>>
>>>>> But I found a way in which I don't have the problem: if I start
>>>>> mcuHandler
>>>>> at the end of the script, e.g. on line 91, in stead of in the beginning
>>>>> (now
>>>>> on line 23) I do get OldData from the port, and not NoData.
>>>>>
>>>>> This thus solves my problem, but I find it weird why this happens..
>>>>>
>>>> It seems completely normal to me, since you create the connection
>>>> after the write (which happens in your startHook). The data never
>>>> arrived in the receiving component.
>>> Ah, ok, I see.
>>>
>>> Thanks,
>>> Kurt
>>
>> A piece of advice: separate deployment from runtime use. I mean: use the
>> deployment script to get all your components up, but not yet running. Once
>> they are all ready, only then you let your coordinator send out a run event
>> after which data can begin to flow.
>>
>> This is the logic of having (at least) four separate phases in the
>> "development process":
>> - component development
>> - system building
>> - deployment
>> - runtime
>> Threat them differently, and don't use files or scripts that mix two of
>> them.
>
> That's exactly what we did yesterday after discovering the behavior :-) .

Good! These kind of things are the essence of what we try to make more
clear and document in the BRICS project ("Best Practice in RobotICS"). So,
your experience is a corroboration for me that this piece of advise is
indeed best practice :-)

Herman

Reading port returns NoData when expected OldData

2012/5/16 Kurt Geebelen <kurt [dot] geebelen [..] ...>:
> Hi all,
>
> I have 2 components A and B. They are connected via a port P of type
> std::vector<double>. It is an outputport in component A, and an
> inputport in component B.
>
> In component A, I write to the port in startHook, and then write to it
> sporadically.
>
> Component B is being triggered by an other port, but when it is
> triggered, it should read port P. It doesn't matter if the data on port
> P is old or new.
>
> Now what is happening that the read-command returns NoData, where I
> would expect it to return OldData. I checked in the deployer the value
> of port P in component A, and there really is a value on the port.
>
> Any idea why NoData is returned?

Are the ports connected?

Steven

>
> Best,
> Kurt
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users

Reading port returns NoData when expected OldData

Op 16/05/2012 15:26, Steven Bellens schreef:
> 2012/5/16 Kurt Geebelen<kurt [dot] geebelen [..] ...>:
>> Hi all,
>>
>> I have 2 components A and B. They are connected via a port P of type
>> std::vector<double>. It is an outputport in component A, and an
>> inputport in component B.
>>
>> In component A, I write to the port in startHook, and then write to it
>> sporadically.
>>
>> Component B is being triggered by an other port, but when it is
>> triggered, it should read port P. It doesn't matter if the data on port
>> P is old or new.
>>
>> Now what is happening that the read-command returns NoData, where I
>> would expect it to return OldData. I checked in the deployer the value
>> of port P in component A, and there really is a value on the port.
>>
>> Any idea why NoData is returned?
> Are the ports connected?
Yes. In the ops-script, I have:

var ConnPolicy cp
connect("A.P","B.P",cp)
>
> Steven
>
>> Best,
>> Kurt
>> --
>> Orocos-Users mailing list
>> Orocos-Users [..] ...
>> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users