[Bug 1015] New: Scripting incorrectly processes complex conditional in while() statement

S Roderick <[email protected]>
Newsgroups gmane.science.robotics.orocos.devel
Message-ID <[email protected]/>
http://bugs.orocos.org/show_bug.cgi?id=1015

           Summary: Scripting incorrectly processes complex conditional in
                    while() statement
           Product: RTT
           Version: 1.10.3
          Platform: All
        OS/Version: GNU/Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Scripting
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
   Estimated Hours: 0.0


This works in a v1 Orocos RTT script (part of a .ops file):
{{{
       var bool timedOut = false;
       var bool finished = false;
       // a bug in RTT means that if you put the "finished" condition in the
       // "while" directly, it doesn't work. Using the variable does work.
       while !finished && !timedOut
       {
               do nothing;
               try logInfo(rt_string("Waiting ..."));
               set waited = waited + getPeriod();
               set timedOut = (waited > maxWait);
               set finished = RobotCommands.Sender.inFinalState() &&
                       RobotTelemetry.Sender.inFinalState() &&
                       !isRobotInitialized.Get();
       }
}}}

The following fails. It appears to just pick up the robotInitialized bit, and
not wait for the state machines ("Sender") in the two RobotXXX peer components.
I tried various orderings of the conditional parts.
{{{
       var bool timedOut = false;
       while !RobotCommands.Sender.inFinalState() &&
                       !RobotTelemetry.Sender.inFinalState() &&
                       isRobotInitialized.Get &&
                       !timedOut
       {
               do nothing;
               try logInfo(rt_string("Waiting ..."));
               set waited = waited + getPeriod();
               set timedOut = (waited > maxWait);
       }
}}}

We suspect that this is likely a bug in the v2 Orocos scripting also.

-- 
Configure bugmail: http://bugs.orocos.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
You are the assignee for the bug.
-- 
Orocos-Dev mailing list
[email protected]
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.