Welcome, Guest

Request component control
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Request component control
#2
Request component control 2 Years, 3 Months ago  
Hi,
I'm new to JAUS. I'm trying to take control of a component without knowing its address. Is it possible ?
In my case, I have two components : a controller and an effector. I set my controller authority to 2, and my effector authority to 1. Then my controller send a requestComponentControlMessage to all the components. I implemented the callback for my effector (which checks that the sender of the requestComponentControlMessage has a higher authority, then send a confirmComponentControlMessage). And I also have a callback in my controller for the confirmComponentControlMessage.
The problem is, when the controller send the requestComponentControlMessage, he always get the confirmComponentControlMessage, even though there are no effectors in the system...
What did I do wrong ? (I hope I was clear, if not, don't hesitate to ask me for more details).
Cheers,
Ugo
kentd
Go Gators!
Admin
Posts: 87
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Draco098 Lights Out Photography Draco098 Draco098 Draco098 Location: Charlotte, NC Birthday: 09/20
Last Edit: 2009/10/13 09:13 By kentd.
The administrator has disabled public write access.
There's 10 types of people in the world; those that understand binary and those that don't.
 
#3
Re:Request component control 2 Years, 3 Months ago  
Hello,
I believe the issue you are having is that you are sending a requestComponentControl to all components. This means you are also sending it to the NodeManager and possibly a Communicator component? You may actually be sending it to yourself as well (interesting thought there)... anyway, you want to explicitly send the request to the effector component and only the effector component. You can query the NodeManager for the JAUS address of the effector component by using the function nodeManagerLookupAddress() or nodeManagerLookupServiceAddress() in the nodeManagerInterface.h file. You can lookup the effector by component ID or service number.

There is an example of this in the ojVehicleSim in the wd.c file:
Code:

void wdInitState(OjCmpt wd)
{
   WdData *data;
   data = (WdData*)ojCmptGetUserData(wd);
   if(data->pdAddress->node == 0)
   {
      if(ojCmptLookupAddress(wd, data->pdAddress))
      {
         jausAddressCopy(data->setWrench->destination, data->pdAddress);
      }
   }


Hope that helps!
~Danny
kentd
Go Gators!
Admin
Posts: 87
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Draco098 Lights Out Photography Draco098 Draco098 Draco098 Location: Charlotte, NC Birthday: 09/20
The administrator has disabled public write access.
There's 10 types of people in the world; those that understand binary and those that don't.
 
#4
Re:Request component control 2 Years, 3 Months ago  
Thanks a lot for your answer. I used the ojCmptLookupAddress and it worked.

I still have one question : is it possible to find a component using its name (corresponds to "identification" in a jaus message) ?

Cheers,
ugo
kentd
Go Gators!
Admin
Posts: 87
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Draco098 Lights Out Photography Draco098 Draco098 Draco098 Location: Charlotte, NC Birthday: 09/20
Last Edit: 2009/10/13 09:14 By kentd.
The administrator has disabled public write access.
There's 10 types of people in the world; those that understand binary and those that don't.
 
#5
Re:Request component control 2 Years, 3 Months ago  
Good question! No, currently there is no mechanism to query the NM for a JAUS Address using the Component Identification field. This is mostly due to the fact that the Component Identification field is considered a human-readable additive to the system tree and not something critical to the component-to-component interactions. Though it may not be a bad idea to add this feature.
kentd
Go Gators!
Admin
Posts: 87
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Draco098 Lights Out Photography Draco098 Draco098 Draco098 Location: Charlotte, NC Birthday: 09/20
The administrator has disabled public write access.
There's 10 types of people in the world; those that understand binary and those that don't.
 
Go to topPage: 1
Copyright © 2012 OpenJAUS. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.