Re: [Orocos] Cascaded change of state

Peter Soetens <[email protected]> Fri, 17 Dec 2004 14:57:49 +0100
Newsgroups gmane.science.robotics.orocos.devel,gmane.science.robotics.orocos.user
Organization KU Leuven
Message-ID <[email protected]>
On Thursday 16 December 2004 14:37, Marco Gritti wrote:
> Hi everybody,
>
> At Politecnico di Milano we recently implemented an OROCOS
> based controller for a 6 axis robot (actually tested only
> on a simulator).
>
> Maybe Peter remembers it from his last visit :)

Hello Marco, 
'glad  that you're still with us :-) For more technical questions, please use 
the orocos-dev list as much as possible.

>
> We are now trying to implement a cascaded control kernel
> schema which uses the old control kernel as inner kernel,
> and has a new control kernel that grabs the trajectory
> input from a joystick, sampled at a lower frequency.

Could you specify type class type of the kernel and version of Orocos
that you are using ?

>
> We are now facing the problem of issuing the kernel START
> command from an HMI console device.
>
> In the old application the console 'start' command
> triggers the transition from a state in which the robot is
> still with brakes ON to a state in which the robot is
> still with brakes OFF, and the motors are sustaining it.
>
> In the new application we want to assign the upper kernel
> to the HMI console input, and we want to pass the START
> information from the upper kernel to the lower one. This
> is a kind of "cascaded configuration flow".

This is a typical application of the Task Infrastructure of Orocos 0.18.0.
It is so that both kernels are linked and should be synchronised. The task 
infrastructure allows you easily to send such a start command (or any) from 
one task to the other, in a thread-safe way.

>
> But we do not know how a change of state of the upper
> kernel can trigger a change of state in the lower kernel.
> We don't even know if this is possible.

This is possible in 0.16.0, but it requires too much inside knowledge of 
Orocos. 0.18 brings this technology to user level through tasks.

>
> Is there any "common" solution to this problem, or the
> problem is not well formulated?

It is a common problem and well formulated :-)
You'd like to have a start() commando on the first kernel and let decide
the cascading kernel to call start().

To show you how easy this is in 0.18, I'll write the script code down :
Script For inner kernel :
export function start()
{
      // if you add a bool attribute startup_flag to 
      // innerkernel task :
      set innerkernelname.startup_flag = true
      // or
      do states.my_statemachine.start()
}

Script For outer kernel :
export function startAll()
{
 do innerkernelname.start()
}

If you then connect the HMI or TaskBrowser to the outer kernel, 
typing startAll() will call start of the inner kernel. Off course the start() 
and startAll() functions can be called from a state machine or a program or 
command line.

Peter

PS : 
The changes between 0.16 and 0.18 on Control Kernel are quite minimal,
So a transition to this version might be worth your effort.
See <http://www.orocos.org/releases/orocos-changes-0.18.0.html>

-- 
------------------------------------------------------------------------
Peter Soetens, Research Assistant                  http://www.orocos.org
Katholieke Universiteit Leuven
Division Production Engineering,                      tel. +32 16 322773
Machine Design and Automation                         fax. +32 16 322987
Celestijnenlaan 300B                   [email protected]
B-3001 Leuven Belgium                 http://www.mech.kuleuven.ac.be/pma
------------------------------------------------------------------------