From: Hedayat V. <hed...@ai...> - 2007-06-08 13:10:29
Attachments:
smime.p7s
|
Hi, I've changed MoveAgent for the new agent (thanks BeamEffector!) and fixed ClearPlayers functions. I don't know if I'm going in the right direction or not! It seems that most of the old code can be used with little or no modification (UpdateKickOff for example). Am I right?!! Thanks! Hedayat |
From: Hesham <hes...@gm...> - 2007-06-09 04:20:11
|
Hi Hedayat, Could you please let me know which functions you're working on, so I'll give the others a try. Cheers, Hesham On 6/8/07, Hedayat Vatankhah <hed...@ai...> wrote: > > Hi, > > I've changed MoveAgent for the new agent (thanks BeamEffector!) and fixed > ClearPlayers functions. I don't know if I'm going in the right direction or > not! It seems that most of the old code can be used with little or no > modification (UpdateKickOff for example). Am I right?!! > > > Thanks! > > Hedayat > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Simspark Generic Physical MAS Simulator > simspark-devel mailing list > sim...@li... > https://lists.sourceforge.net/lists/listinfo/simspark-devel > > > |
From: Hedayat V. <hed...@ai...> - 2007-06-09 19:57:19
Attachments:
smime.p7s
soccerruleaspect.cpp.bz2
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=UTF-8" http-equiv="Content-Type"> </head> <body dir="ltr" bgcolor="#ffffff" text="#000000"> <small><font size="+1"><small>Hi Hesham,<br> OK, from now, I'll (hopefully!) add new function(s) to calculate the AABB2 or AABB3 around an agent to be used instead of a single position in functions such as ClearPlayers functions.<br> <br> Just for completeness, I've attached my latest soccerrulesaspect.cpp file.<br> <br> Good luck,<br> Hedayat<br> </small></font></small><span><br> <style type="text/css">blockquote {color: navy !important; background-color: RGB(245,245,245) !important; padding: 0 15 10 15 !important; margin: 15 0 0 0; border-left: #1010ff 2px solid;} blockquote blockquote {color: maroon !important; background-color: RGB(235,235,235) !important; border-left-color:maroon !important} blockquote blockquote blockquote {color: green !important; background-color: RGB(225,225,225) !important; border-left-color:teal !important} blockquote blockquote blockquote blockquote {color: purple !important; background-color: RGB(215,215,215) !important; border-left-color: purple !important} blockquote blockquote blockquote blockquote blockquote {color: teal !important; background-color: RGB(205,205,205) !important; border-left-color: green !important}</style><i><b>Hesham <a class="moz-txt-link-rfc2396E" href="mailto:hes...@gm..."><hes...@gm...></a></b></i> wrote on 06/09/2007 07:50:09 AM:</span><br> <blockquote style="border-left: 2px solid rgb(16, 16, 255); color: navy; background-color: rgb(245, 245, 245); padding-left: 15px;" cite="mid:1d7...@ma..." type="cite"><br> Hi Hedayat,<br> <br> Could you please let me know which functions you're working on, so I'll give the others a try.<br> <br> Cheers,<br> Hesham<br> <br> <div><span class="gmail_quote">On 6/8/07, <b class="gmail_sendername"> Hedayat Vatankhah</b> <<a moz-do-not-send="true" href="mailto:hed...@ai...">hed...@ai...</a>> wrote:</span> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div dir="ltr" bgcolor="#ffffff" text="#000000"> <p style="margin-bottom: 0cm; margin-top: 0pt;"><small><font size="+1"><small>Hi,</small></font></small></p> <p style="margin-bottom: 0cm; margin-top: 0pt;">I've changed MoveAgent for the new agent (thanks BeamEffector!) and fixed ClearPlayers functions. I don't know if I'm going in the right direction or not! It seems that most of the old code can be used with little or no modification (UpdateKickOff for example). Am I right?!!</p> <p style="margin-bottom: 0cm; margin-top: 0pt;"><br> </p> <p style="margin-bottom: 0cm; margin-top: 0pt;">Thanks!</p> <p style="margin-bottom: 0cm; margin-top: 0pt;">Hedayat</p> <p style="margin-bottom: 0cm; margin-top: 0pt;"><br> </p> </div> <br> -------------------------------------------------------------------------<br> This SF.net email is sponsored by DB2 Express<br> Download DB2 Express C - the FREE version of DB2 express and take<br> control of your XML. No limits. Just data. Click to get it now. <br> <a moz-do-not-send="true" onclick="return top.js.OpenExtLink(window,event,this)" href="http://sourceforge.net/powerbar/db2/" target="_blank">http://sourceforge.net/powerbar/db2/</a><br> _______________________________________________<br> Simspark Generic Physical MAS Simulator <br> simspark-devel mailing list<br> <a moz-do-not-send="true" onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:sim...@li...">sim...@li...</a><br> <a moz-do-not-send="true" onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.sourceforge.net/lists/listinfo/simspark-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/simspark-devel</a><br> <br> <br clear="all"> </blockquote> </div> <br> </blockquote> </body> </html> |
From: Markus R. <rol...@un...> - 2007-06-11 10:10:55
|
Hi, On Sun, 10 Jun 2007, Joschka Boedecker wrote: [...] > This is not the only place where FindChildSupportingClass is used, and > in other cases, it seems to work (as does ListChildrenSupportingClass > which basically works the same way). Maybe it has something to do with > the recursion, but from looking at the code in lib/zeitgeist/leaf.h, I > couldn't find anything suggesting that. Markus, in case you read that, > do you have any idea why this could happen? yes, I think the problem is that in the recursive case the result of FindChildSupportingClass(...) for the first found child is immediately returned. So if the first child does not have a matching node the function returns immediately false instead of testing further children. The fix should be to add a second inner loop that checks all children of the current node and then returns for the first found node. Cheers, Markus |
From: Joschka B. <jbo...@un...> - 2007-06-10 07:42:00
|
Hi Hedayat, Hedayat Vatankhah wrote: > Hi Hesham, > OK, from now, I'll (hopefully!) add new function(s) to calculate the > AABB2 or AABB3 around an agent to be used instead of a single position > in functions such as ClearPlayers functions. Just some thoughts which might make this task easier: Each agent is linked into the SceneGraph at a position "/usr/scene/AgentAspectX" in the virtual file system of the zeitgeist framework, with X being the ID of the agent. All the nodes of the agent will be below this node. The actual AgentAspect of the SoccerBot, e.g. for agent with ID 1, will then be at: /usr/scene/AgentAspect1/spaceman/body The "spaceman" is the collision space that encapsulates all the nodes of the agent, and "body" is the name that we set for the AgentAspect in the soccerbot.rsg file. If you have the AgentAspect of a certain agent and you want to get the bounding box containing all of the agents bodies, it should be sufficient to get to the collision space using GetParent and then using the GetWorldBoundingBox method (implemented in the BaseNode class, from which Space is derived). Just to be sure, you could do a UpdateHierarchy (also from BaseNode) before you get the bounding box, but I think it is not necessary. Cheers, Joschka |
From: <hed...@ai...> - 2007-06-10 08:42:06
|
Hi, Thank you for your help. It'll really save my time. (I would probably missed the GetWorldBoundingBox function!). A question (which will help me to understand the code better): The original ClearPlayers functions were using GetAgentBody function which uses FindChildSupportingClass function. It was unable to find any Body node in the AgentAspect's children (body AgentAspect). But when I modified the GetAgentBody function to use GetChildSupportingClass (or maybe the GetChildOfClass, I don't remember now!), it successfully returned the first Body object. (This is the function that the GetBody function uses). Why the FindChildSupportingClass function is unable to find an object of the Body class while there is such an object in it's children?! Thanks for your patience, Hedayat -----Original Message----- From: Joschka Boedecker <jbo...@un...> To: Hedayat Vatankhah <hed...@ai...> Cc: Simspark Devel ML <sim...@li...> Sent: Sun, 10 Jun 2007 11:11 am Subject: Re: [simspark-devel] About SoccerRules Hi Hedayat,? ? Hedayat Vatankhah wrote:? > Hi Hesham,? > OK, from now, I'll (hopefully!) add new function(s) to calculate the > AABB2 or AABB3 around an agent to be used instead of a single position > in functions such as ClearPlayers functions.? ? Just some thoughts which might make this task easier:? ? Each agent is linked into the SceneGraph at a position "/usr/scene/AgentAspectX" in the virtual file system of the zeitgeist framework, with X being the ID of the agent. All the nodes of the agent will be below this node. The actual AgentAspect of the SoccerBot, e.g. for agent with ID 1, will then be at:? ? /usr/scene/AgentAspect1/spaceman/body? ? The "spaceman" is the collision space that encapsulates all the nodes of the agent, and "body" is the name that we set for the AgentAspect in the soccerbot.rsg file.? ? If you have the AgentAspect of a certain agent and you want to get the bounding box containing all of the agents bodies, it should be sufficient to get to the collision space using GetParent and then using the GetWorldBoundingBox method (implemented in the BaseNode class, from which Space is derived). Just to be sure, you could do a UpdateHierarchy (also from BaseNode) before you get the bounding box, but I think it is not necessary.? ? Cheers,? Joschka? ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. |
From: Joschka B. <jbo...@un...> - 2007-06-10 06:04:26
|
Hi Hedayat, Hedayat Vatankhah wrote: > > I've changed MoveAgent for the new agent (thanks BeamEffector!) and > fixed ClearPlayers functions. > Great, thank you. I've just committed a bunch of changes to the SoccerBase (mainly to increase performance) and I've moved the MoveAgent code to this class. This way, it is accessible to other classes, too. I'm using it in the BeamEffector, the SoccerRuleAspect, and the TrainerCommandParser now. By the way, the TrainerCommandParser should be ready to be used with simspark now, so hopefully, this should make testing the rule stuff a little easier :-) > I don't know if I'm going in the right direction or not! It seems that > most of the old code can be used with little or no modification > (UpdateKickOff for example). Am I right?!! > > Yes, you're right. Most of the code should work now, so we can re-activate the commented out portions of the code little by little and test (I already activated the UpdateKickOff part in the SIMSPARK_RULES branch of the CVS). One of my main concerns was the performance drop the integration of the rules might bring, but I hope my latest commits might help to deal with that (crossing my fingers that I didn't break anything ;-) ). I'm now working on a new SimControlNode that allows to display GameState info in the internal monitor since I'm having a hard time with monitorspark. If you implement the BoundingBox methods for the agent, maybe you can put them in the SoccerBase class. I think they might be useful for other classes, too. Cheers, Joschka |
From: Joschka B. <jbo...@un...> - 2007-06-10 09:01:13
|
Hi Hedayat, hed...@ai... wrote: > Thank you for your help. It'll really save my time. (I would probably > missed the GetWorldBoundingBox function!). :-) > A question (which will help me to understand the code better): > The original ClearPlayers functions were using GetAgentBody function > which uses FindChildSupportingClass function. It was unable to find > any Body node in the AgentAspect's children (body AgentAspect). Yes, I also noticed that. I changed the GetAgentBody method back to use the GetChildOfClass function. It should work now. > But when I modified the GetAgentBody function to use > GetChildSupportingClass (or maybe the GetChildOfClass, I don't > remember now!), it successfully returned the first Body object. (This > is the function that the GetBody function uses). Why the > FindChildSupportingClass function is unable to find an object of the > Body class while there is such an object in it's children?! Exactly this problem caused me lots of headaches yesterday, and I finally gave up to try and understand it. The Body child node is definitely there in the hierarchy, and it is easily found by GetChildOfClass, but the FindChildSupportingClass (with recursion enabled) will miss it. The FindChildSupportingClass method tries to dynamically cast the shared pointers to the nodes it finds when descending the SceneGraph, and to my understanding, a cast from a Body node to a Body node should be successful. It seems that the casted pointer will always be NULL though :-( This is not the only place where FindChildSupportingClass is used, and in other cases, it seems to work (as does ListChildrenSupportingClass which basically works the same way). Maybe it has something to do with the recursion, but from looking at the code in lib/zeitgeist/leaf.h, I couldn't find anything suggesting that. Markus, in case you read that, do you have any idea why this could happen? Cheers, Joschka |
From: Markus R. <rol...@un...> - 2007-06-11 17:31:04
|
Markus Rollmann wrote: [...] > yes, I think the problem is that in the recursive case the result of > FindChildSupportingClass(...) for the first found child is immediately > returned. So if the first child does not have a matching node the function > returns immediately false instead of testing further children. > > The fix should be to add a second inner loop that checks all children of the > current node and then returns for the first found node. I commited a fix to the simspark CVS, a second loop wasn't necessary. Find the diff below. regards, Markus Index: leaf.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/leaf.h,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** leaf.h 17 May 2007 17:46:45 -0000 1.3 --- leaf.h 11 Jun 2007 17:27:05 -0000 1.3.2.1 *************** *** 130,134 **** if (recursive) { ! return (*i)->FindChildSupportingClass<CLASS>(recursive); } } --- 130,138 ---- if (recursive) { ! child = (*i)->FindChildSupportingClass<CLASS>(recursive); ! if (child.get() != 0) ! { ! return child; ! } } } |
From: Joschka B. <jbo...@un...> - 2007-06-12 10:38:31
|
Hey Markus, On Mon, 2007-06-11 at 19:30 +0200, Markus Rollmann wrote: > Markus Rollmann wrote: > [...] > > yes, I think the problem is that in the recursive case the result of > > FindChildSupportingClass(...) for the first found child is immediately > > returned. So if the first child does not have a matching node the function > > returns immediately false instead of testing further children. > > > > The fix should be to add a second inner loop that checks all children of the > > current node and then returns for the first found node. > > I commited a fix to the simspark CVS, a second loop wasn't necessary. > Find the diff below. Great, thanks a lot! cu Joschka |