Loading ...
Sorry, an error occurred while loading the content.
 

XWalkNode XWalkMC functionality seems broken or not completed

Expand Messages
  • jpt564
    The following is how we implemented a work around to use the XWalkNode as one would use the WalkNode. I am unsure as to how the XWalkNode is supposed to work
    Message 1 of 2 , Apr 1, 2009
      The following is how we implemented a work around to use the XWalkNode as one would use the WalkNode.

      I am unsure as to how the XWalkNode is supposed to work and if it is supposed to be behaving this way so any information would be helpful.

      In the XWalkNode.h file we created the constructor:

      XXWalkNode(const std::string& name, float xvel, float yvel, float avel, MotionManager::MC_ID mc_in) : MCNode<XWalkMC,defWalkNodeName,defWalkNodeDesc>(name), persist_xvel(0), persist_yvel(0), persist_avel(0) {
      setMC(mc_in);
      persist_xvel = xvel;
      persist_yvel = yvel;
      persist_avel = avel;
      }


      Problem: the velocities we passed in through the constructor were being set to some random -walkid- but we wanted all our nodes using the same one.

      Solution: We passed in the XwalkMC -walkid- value and set this nodes MC to the one we passed in from our statemachine.

      _________________________

      Problem: The XWalkNode, unlike the WalkNode does not store the velocities you pass in to the constructor within the node itself. Instead the velocities are stored within XWalkMC which has its velocities reset to (0,0,0) every time the node is exited. This clears the only stored instances of the velocities given the constructor.

      Solution: Persist_xvel and so on are the variables we created in XWalkNode.h to store the velocities within the node so that when the node is returned to it can use them to set the XWalkMC.

      _________________________

      Problem: velocity was being read in from the XWalkMC which was always being set to (0,0,0)

      Solution: So in the start function of the node we added
      getMC()->setTargetVelocity(persist_xvel, persist_yvel, persist_avel);
      -to reset the velocity.
      __________________________
      We use the node like so:

      SharedObject<XWalkMC> walk;
      walkid=motman->addPersistentMotion(walk);
      XWalkNode * Think =NULL;
      addNode(Think=new XWalkNode(getName()+"::Think",0,0,0,walkid));
      Think->setMC(walkid);

      ----------------
      These changes now enable us to use the XWalkNode as one would use the WalkNode except we must pass in the walkid. So it can now leave the state and later return to it using the velocity set in the constructor. Prior to these changes the velocity would always be (0,0,0) and the Chiara would not walk.


      Any information on the proper behavior and/or known issues with XWalkNode would be appreciated but for now this works as we need it.
    • Ethan Tira-Thompson
      ... These sound like good changes. If you d like to submit the code, use the cvs diff command: cd Tekkotsu cvs diff Behaviors/Nodes/XWalkNode.h
      Message 2 of 2 , Apr 1, 2009
        > The following is how we implemented a work around to use the
        > XWalkNode as one would use the WalkNode.
        These sound like good changes. If you'd like to submit the code, use
        the cvs diff command:
        cd Tekkotsu
        cvs diff Behaviors/Nodes/XWalkNode.h > xwalknode.patch

        Then email me the xwalknode.patch file :)

        Thanks!
        -Ethan
      Your message has been successfully submitted and would be delivered to recipients shortly.