| Homepage | Demos | Overview | Downloads | Tutorials | Reference | Credits |
#include <WalkMC.h>
Inheritance diagram for WalkMC:

Moves the feet through a looping path in order to walk - default parameters use a walk low to the ground so you don't walk over the ball.
This portion of the code falls under CMPack's license:
=========================================================================
CMPack'02 Source Code Release for OPEN-R SDK v1.0
Copyright (C) 2002 Multirobot Lab [Project Head: Manuela Veloso]
School of Computer Science, Carnegie Mellon University
-------------------------------------------------------------------------
This software is distributed under the GNU General Public License,
version 2. If you do not have a copy of this licence, visit
www.gnu.org, or write: Free Software Foundation, 59 Temple Place,
Suite 330 Boston, MA 02111-1307 USA. This program is distributed
in the hope that it will be useful, but WITHOUT ANY WARRANTY,
including MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-------------------------------------------------------------------------
Additionally licensed to Sony Corporation under the following terms:
This software is provided by the copyright holders AS IS and any
express or implied warranties, including, but not limited to, the
implied warranties of merchantability and fitness for a particular
purpose are disclaimed. In no event shall authors be liable for
any direct, indirect, incidental, special, exemplary, or consequential
damages (including, but not limited to, procurement of substitute
goods or services; loss of use, data, or profits; or business
interruption) however caused and on any theory of liability, whether
in contract, strict liability, or tort (including negligence or
otherwise) arising in any way out of the use of this software, even if
advised of the possibility of such damage.
=========================================================================
Definition at line 51 of file WalkMC.h.
Public Types | |
| typedef SplinePath< vector3d, double > | splinepath |
| for convenience | |
| typedef HermiteSplineSegment< vector3d, double > | spline |
| for convenience | |
Public Member Functions | |
| WalkMC (const char *pfile=NULL) | |
| constructor | |
| virtual void | DoStart () |
| sends an activate LocomotionEvent | |
| virtual void | DoStop () |
| sends a deactivate LocomotionEvent | |
| virtual int | updateOutputs () |
| calculates current positions of the paws | |
| virtual int | isDirty () |
| Returns true if we are walking. This modified isDirty allows the AIBO to slow down to a stop rather than stopping immediately. | |
| virtual int | isAlive () |
| always true - never autoprunes | |
| void | load (const char *pfile) |
| loads parameters from a file ( | |
| void | save (const char *pfile) const |
| saves parameters to a file ( | |
| void | setTargetVelocity (double dx, double dy, double da) |
| set the direction to walk - can specify x (forward), y (left), and angular (counterclockwise) velocities | |
| const vector3d & | getTargetVelocity () |
| returns current velocity we're trying to go | |
| const vector3d & | getCurVelocity () const |
| returns the velocity we're actually moving (subject to clipping at max_accel_xya), doesn't reflect value of getPaused()... | |
| unsigned int | getTravelTime () |
| returns the time we've been traveling along the current vector | |
| void | setPaused (bool p) |
| if set to true, will stop moving | |
| bool | getPaused () const |
| if is true, we aren't moving | |
| void | setHeight (double h) |
| sets WalkParam::body_height of wp | |
| double | getHeight () |
| gets WalkParam::body_height of wp | |
| void | setAngle (double a) |
| sets WalkParam::body_angle of wp | |
| double | getAngle () |
| gets WalkParam::body_angle of wp | |
| void | setHop (double h) |
| sets WalkParam::hop of wp | |
| double | getHop () |
| gets WalkParam::hop of wp | |
| void | setSway (double h) |
| sets WalkParam::sway of wp | |
| double | getSway () |
| gets WalkParam::sway of wp | |
| void | setPeriod (long p) |
| sets WalkParam::period of wp | |
| long | getPeriod () |
| gets WalkParam::period of wp | |
| void | setSlowMo (float p) |
| sets slowmo | |
| float * | getSlowMo () |
| gets slowmo | |
| WalkParam & | getWP () |
| void | resetLegPos () |
| takes current leg positions from WorldState and tries to match the point in the cycle most like it | |
Static Public Attributes | |
| const float | MAX_DX = 180 |
| ==180 mm/sec | |
| const float | MAX_DY = 140 |
| ==140 mm/sec | |
| const float | MAX_DA = 1.8 |
| ==1.8 rad/sec | |
| const vector3d | max_accel_xya |
| maximum acceleration of x, y, and a velocity | |
Protected Member Functions | |
| void | init (const char *pfile) |
| does some setup stuff, calls load(pfile) | |
Protected Attributes | |
| OutputCmd | cmds [NumOutputs][NumFrames] |
| holds current joint commands | |
| bool | isPaused |
| true if we are paused | |
| WalkParam | wp |
| current walking parameters (note that it's not static - different WalkMC's can have different setting, handy... | |
| LegWalkState | legw [NumLegs] |
| current state of each leg | |
| vector3d | legpos [NumLegs] |
| current position of each leg | |
| splinepath | body_loc |
| the path the body goes through while walking (?) | |
| splinepath | body_angle |
| the path the body goes through while walking (?) | |
| vector3d | pos_delta |
| how much we've moved | |
| double | angle_delta |
| how much we've turned | |
| unsigned int | travelTime |
| the time since the last call to setTargetVelocity - handy to check the time we've been traveling current vector | |
| int | time |
| time of last call to updateJointCmds() (scaled by slowmo) | |
| int | TimeStep |
| time to pretend passes between each call to updateJointCmds() - usually RobotInfo::FrameTime | |
| float | slowmo |
| scales time values to make the walk move in slow motion for analysis (or fast forward) | |
| int | CycleOffset |
| int | TimeOffset |
| bool | NewCycleOffset |
| vector3d | vel_xya |
| the current velocity we're moving | |
| vector3d | target_vel_xya |
| the velocity that was requested | |
|
|
for convenience
|
|
|
for convenience
|
|
|
constructor
Definition at line 62 of file WalkMC.cc. References ERS210Info::FrameTime, get_time(), init(), and time. |
Here is the call graph for this function:

|
|
sends an activate LocomotionEvent
Reimplemented from MotionCommand. Definition at line 77 of file WalkMC.cc. References EventBase::activateETID, MotionCommand::DoStart(), get_time(), MotionManagerMsg::getID(), EventBase::locomotionEGID, MotionCommand::postEvent(), LocomotionEvent::setXYA(), target_vel_xya, travelTime, GVector::vector3d< num >::x, GVector::vector3d< num >::y, and GVector::vector3d< num >::z. |
Here is the call graph for this function:

|
|
sends a deactivate LocomotionEvent
Reimplemented from MotionCommand. Definition at line 85 of file WalkMC.cc. References EventBase::deactivateETID, MotionCommand::DoStop(), get_time(), MotionManagerMsg::getID(), EventBase::locomotionEGID, MotionCommand::postEvent(), LocomotionEvent::setXYA(), target_vel_xya, travelTime, GVector::vector3d< num >::x, GVector::vector3d< num >::y, and GVector::vector3d< num >::z. |
Here is the call graph for this function:

|
|
gets WalkParam::body_angle of wp
Definition at line 117 of file WalkMC.h. References WalkMC::WalkParam::body_angle, and wp. |
|
|
returns the velocity we're actually moving (subject to clipping at max_accel_xya), doesn't reflect value of getPaused()...
|
|
|
gets WalkParam::body_height of wp
Definition at line 115 of file WalkMC.h. References WalkMC::WalkParam::body_height, and wp. |
|
|
gets WalkParam::hop of wp
Definition at line 119 of file WalkMC.h. References WalkMC::WalkParam::hop, and wp. |
|
|
if is true, we aren't moving
Definition at line 113 of file WalkMC.h. References isPaused. |
|
|
gets WalkParam::period of wp
Definition at line 123 of file WalkMC.h. References WalkMC::WalkParam::period, and wp. |
|
|
gets slowmo
Definition at line 125 of file WalkMC.h. References slowmo. |
|
|
gets WalkParam::sway of wp
Definition at line 121 of file WalkMC.h. References WalkMC::WalkParam::sway, and wp. |
|
|
returns current velocity we're trying to go
Definition at line 106 of file WalkMC.h. References target_vel_xya, and vector3d. |
|
|
returns the time we've been traveling along the current vector
Definition at line 110 of file WalkMC.h. References get_time(), and travelTime. |
Here is the call graph for this function:

|
|
Definition at line 127 of file WalkMC.h. References wp. |
|
|
does some setup stuff, calls load(pfile)
Definition at line 94 of file WalkMC.cc. References WalkMC::LegWalkState::air, WalkMC::WalkParam::body_angle, body_angle, WalkMC::WalkParam::body_height, body_loc, GetLegPosition(), SplinePath::init(), ERS210Info::JointsPerLeg, legpos, legw, load(), ERS210Info::NumLegs, vector3d, and wp. |
Here is the call graph for this function:

|
|
always true - never autoprunes
Implements MotionCommand. |
|
|
Returns true if we are walking. This modified isDirty allows the AIBO to slow down to a stop rather than stopping immediately.
Implements MotionCommand. Definition at line 119 of file WalkMC.cc. References isPaused, target_vel_xya, vel_xya, GVector::vector3d< num >::x, GVector::vector3d< num >::y, and GVector::vector3d< num >::z. |
|
|
loads parameters from a file (
Definition at line 131 of file WalkMC.cc. References checksum(), mzero(), read_file(), and wp. |
Here is the call graph for this function:

|
|
takes current leg positions from WorldState and tries to match the point in the cycle most like it
Definition at line 299 of file WalkMC.cc. References GetLegPosition(), ERS210Info::JointsPerLeg, ERS210Info::LegOffset, legpos, ERS210Info::NumLegs, WorldState::outputs, and state. |
Here is the call graph for this function:

|
|
saves parameters to a file (
Definition at line 139 of file WalkMC.cc. References checksum(), save_file(), and wp. |
Here is the call graph for this function:

|
|
sets WalkParam::body_angle of wp
Definition at line 116 of file WalkMC.h. References WalkMC::WalkParam::body_angle, and wp. |
|
|
sets WalkParam::body_height of wp
Definition at line 114 of file WalkMC.h. References WalkMC::WalkParam::body_height, and wp. |
|
|
sets WalkParam::hop of wp
Definition at line 118 of file WalkMC.h. References WalkMC::WalkParam::hop, and wp. |
|
|
if set to true, will stop moving
Definition at line 112 of file WalkMC.h. References isPaused. |
|
|
sets WalkParam::period of wp
Definition at line 122 of file WalkMC.h. References WalkMC::WalkParam::period, and wp. |
|
|
sets slowmo
Definition at line 124 of file WalkMC.h. References slowmo. |
|
|
sets WalkParam::sway of wp
Definition at line 120 of file WalkMC.h. References WalkMC::WalkParam::sway, and wp. |
|
||||||||||||||||
|
set the direction to walk - can specify x (forward), y (left), and angular (counterclockwise) velocities
Definition at line 145 of file WalkMC.cc. References bound(), da, dx, get_time(), MotionManagerMsg::getID(), MotionCommand::isActive(), GVector::vector2d< num >::length(), EventBase::locomotionEGID, MAX_DA, MAX_DX, MAX_DY, MotionCommand::postEvent(), GVector::vector3d< num >::set(), LocomotionEvent::setXYA(), EventBase::statusETID, target_vel_xya, travelTime, vector2d, GVector::vector2d< num >::x, and GVector::vector2d< num >::y. |
Here is the call graph for this function:

|
Here is the call graph for this function:

|
|
how much we've turned
|
|
|
the path the body goes through while walking (?)
|
|
|
the path the body goes through while walking (?)
|
|
|
holds current joint commands
|
|
|
The CycleOffset variable is used to ensure that each time the AIBO starts walking, it starts at the same point in the walk cycle as where it stopped. This measure is intended to decrease the amount of jerking (and hence deviation) that occurs when the AIBO starts walking forward and then suddenly stops. |
|
|
true if we are paused
|
|
|
current position of each leg
|
|
|
current state of each leg
|
|
|
maximum acceleration of x, y, and a velocity
|
|
|
==1.8 rad/sec
|
|
|
==180 mm/sec
|
|
|
==140 mm/sec
|
|
|
Every time we stop, we know we'll have a new CycleOffset, and we'll need to compute a new TimeOffset. This boolean says as much. |
|
|
how much we've moved
|
|
|
scales time values to make the walk move in slow motion for analysis (or fast forward)
|
|
|
the velocity that was requested
|
|
|
time of last call to updateJointCmds() (scaled by slowmo)
|
|
|
Each CycleOffset corresponds to a different TimeOffset once the robot starts walking again. Consider this example: the robot stops 2/3 of the way through the cycle, then starts again 1/3 of the way through the cycle on the absolute clock. The time offset to advance the clock to the right part of the cycle is 1/3 of a cycle, so we set TimeOffset to 1/3 cycle and add that to every clock value used in the walk code. |
|
|
time to pretend passes between each call to updateJointCmds() - usually RobotInfo::FrameTime
|
|
|
the time since the last call to setTargetVelocity - handy to check the time we've been traveling current vector
|
|
|
the current velocity we're moving
|
|
|
current walking parameters (note that it's not static - different WalkMC's can have different setting, handy...
|
|
Tekkotsu v1.5 |
Generated Fri Oct 10 15:58:23 2003 by Doxygen 1.3.4 |