MTNWALKAgent7.cc

Go to the documentation of this file.
00001 //
00002 // Copyright 2004 Sony Corporation 
00003 //
00004 // Permission to use, copy, modify, and redistribute this software for
00005 // non-commercial use is hereby granted.
00006 //
00007 // This software is provided "as is" without warranty of any kind,
00008 // either expressed or implied, including but not limited to the
00009 // implied warranties of fitness for a particular purpose.
00010 //
00011 
00012 #include <OPENR/OPENRAPI.h>
00013 #include "MTNWALKAgent7.h"
00014 
00015 bool
00016 MTNWALKAgent7::AreYou(MoNetAgentID agent)
00017 {
00018     OSYSDEBUG(("MTNWALKAgent7::AreYou(%d)\n", agent));
00019     return (agent == monetagentMTNWALK) ? true : false;
00020 }
00021 
00022 void
00023 MTNWALKAgent7::SetJointGain()
00024 {
00025     OSYSDEBUG(("MTNWALKAgent7::SetJointGain()\n"));
00026 
00027     OPrimitiveID tilt1ID = moNetAgentManager->PrimitiveID(HEAD_TILT1);
00028     OPrimitiveID panID   = moNetAgentManager->PrimitiveID(HEAD_PAN);
00029     OPrimitiveID tilt2ID = moNetAgentManager->PrimitiveID(HEAD_TILT2);
00030 
00031     OPENR::EnableJointGain(tilt1ID);
00032     OPENR::SetJointGain(tilt1ID,
00033                         TILT1_PGAIN, TILT1_IGAIN, TILT1_DGAIN,
00034                         PSHIFT, ISHIFT, DSHIFT);
00035     
00036     OPENR::EnableJointGain(panID);
00037     OPENR::SetJointGain(panID,
00038                         PAN_PGAIN, PAN_IGAIN, PAN_DGAIN,
00039                         PSHIFT, ISHIFT, DSHIFT);
00040 
00041     OPENR::EnableJointGain(tilt2ID);
00042     OPENR::SetJointGain(tilt2ID,
00043                         TILT2_PGAIN, TILT2_IGAIN, TILT2_DGAIN,
00044                         PSHIFT, ISHIFT, DSHIFT);
00045 
00046     int base = RFLEG_J1;
00047     for (int i = 0; i < 4; i++) {
00048 
00049         OPrimitiveID j1ID = moNetAgentManager->PrimitiveID(base + 3 * i);
00050         OPrimitiveID j2ID = moNetAgentManager->PrimitiveID(base + 3 * i + 1);
00051         OPrimitiveID j3ID = moNetAgentManager->PrimitiveID(base + 3 * i + 2);
00052         
00053         OPENR::EnableJointGain(j1ID);        
00054         OPENR::SetJointGain(j1ID,
00055                             J1_PGAIN, J1_IGAIN, J1_DGAIN,
00056                             PSHIFT, ISHIFT, DSHIFT);
00057 
00058         OPENR::EnableJointGain(j2ID);
00059         OPENR::SetJointGain(j2ID,
00060                             J2_PGAIN, J2_IGAIN, J2_DGAIN,
00061                             PSHIFT, ISHIFT, DSHIFT);
00062 
00063         OPENR::EnableJointGain(j3ID);
00064         OPENR::SetJointGain(j3ID,
00065                             J3_PGAIN, J3_IGAIN, J3_DGAIN,
00066                             PSHIFT, ISHIFT, DSHIFT);
00067     }
00068 
00069     OPrimitiveID tailtiltID = moNetAgentManager->PrimitiveID(TAIL_TILT);
00070     OPrimitiveID tailpanID  = moNetAgentManager->PrimitiveID(TAIL_PAN);
00071 
00072     OPENR::EnableJointGain(tailtiltID);
00073     OPENR::SetJointGain(tailtiltID,
00074                         TAIL_PGAIN, TAIL_IGAIN, TAIL_DGAIN,
00075                         PSHIFT, ISHIFT, DSHIFT);
00076 
00077     OPENR::EnableJointGain(tailpanID);
00078     OPENR::SetJointGain(tailpanID,
00079                         TAIL_PGAIN, TAIL_IGAIN, TAIL_DGAIN,
00080                         PSHIFT, ISHIFT, DSHIFT);
00081 }

Generated on Sun Dec 2 23:04:29 2007 for openSDK by  doxygen 1.3.9.1