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

button-values

Expand Messages
  • Flup
    Hi all, I have a final project with the aibo ERS-7. The problem is I don t have an aibo, and probably I ll never have one. So I can t test any of the code I
    Message 1 of 2 , Apr 3, 2004
      Hi all,
       
      I have a final project with the aibo ERS-7. The problem is I don't have an aibo, and probably I'll never have one. So I can't test any of the code I write or download from the internet (like the Tekkotsu framework). One purpose of the project is to send all sensordata to a computer and give commands from that computer back to the aibo.
      I have a question about those sensordata.
      First, with sensordata I mean ouput-values (or joint-values), button-values and sensor-values, which are defined in WordlState.h. I have a problem with the button-values. Namely, I can't find code where the button-array is updated. In WorldState.cc there's only this:
       
        // Get foot switches
        chkEvent(er,LFrPawOffset,GETB(ERS7Info::CPCSwitchLFPaw),"LFrPaw");        
        chkEvent(er,RFrPawOffset,GETB(ERS7Info::CPCSwitchRFPaw),"RFrPaw");
        chkEvent(er,LBkPawOffset,GETB(ERS7Info::CPCSwitchLHPaw),"LBkPaw");
        chkEvent(er,RBkPawOffset,GETB(ERS7Info::CPCSwitchRHPaw),"RBkPaw");
       //(by the way: paws are pressure sensors, why convert them in a boolean? Tekkotsu only needs booleans for paws? )
        // Get buttons/switches
        // the sensors are scaled to be relatively similar to the pressure values given by the head on the 210
        chkEvent(er, ERS7Info::ChinButOffset,       GETSENSOR(ERS7Info::CPCSwitchChin),      "ChinBut");
        chkEvent(er, ERS7Info::HeadButOffset,       GETSENSOR(ERS7Info::CPCSensorHead)/120,      "HeadBut");
         chkEvent(er, ERS7Info::FrontBackButOffset,  GETSENSOR(ERS7Info::CPCSensorBackFront)/150, "BkFrBut");
         chkEvent(er, ERS7Info::MiddleBackButOffset, GETSENSOR(ERS7Info::CPCSensorBackMiddle)/150,"BkMdBut");
         chkEvent(er, ERS7Info::RearBackButOffset,   GETSENSOR(ERS7Info::CPCSensorBackRear)/150,  "BkRrBut");
         chkEvent(er, ERS7Info::WirelessSwOffset,GETSENSOR(ERS7Info::CPCSwitchWireless),  "WirelessSw");
       
      So the button-values are only used for event-posting and I didn't find a behavior who updates the values in buttons[], so all values in buttons remain 0...
      Is that correct or am I making a mistake?
       
      Thanks!
       
       
    • Ethan Tira-Thompson
      ... The chkEvent() function that is being called with each button value is two-fold - it checks to see if an event needs to be posted by comparing against the
      Message 2 of 2 , Apr 4, 2004
        > So the button-values are only used for event-posting and I didn't find
        > a behavior who updates the values in buttons[], so all values in
        > buttons remain 0...
        > Is that correct or am I making a mistake?
        The chkEvent() function that is being called with each button value is
        two-fold - it checks to see if an event needs to be posted by comparing
        against the current value in buttons[], and also sets the new value to
        buttons[].

        I see a potential problem tho - it probably should set the new value to
        buttons[] *before* posting the event (so the new value will be
        available to the event listeners in buttons[], as well as within the
        event. Ideally, I think *all* of buttons[] should be up to date before
        *any* events are posted. Hmm)

        Is anyone relying on the buttons[] holding the previous value when an
        event is received? Otherwise i'll change that for the next release,
        before it trips someone up...

        -ethan
      Your message has been successfully submitted and would be delivered to recipients shortly.