User Tools

Site Tools


ece4560:biped:02plotkin

Bipedal Robot Locomotion: Kinematics and Plotting


This week we'll set-up some infrastructure in your Biped Matlab class to visualize arbitrary joint trajectories relative to different (useful) frames of reference.

1. Add a new function to your class:

[ frame1, frame2, biped_frames ] = fwd_kinematics( obj, a_ref_frame )

When a_ref_frame is set to 'TORSO', the method should compute and return the SE(2) pose of the right and left foot frames (and assign them to method outputs, frame1 and frame2) relative to the torso frame. When a_ref_frame is set to 'LEFT_FOOT', it should return the SE(2) pose of the torso and right foot frames (again, assigned to method outputs, frame1 and frame2) relative to the left foot frame. And, finally, when a_ref_frame is set to 'RIGHT_FOOT', it should return the SE(2) pose of the torso and left foot frames relative to the right foot frame.

biped_frames should contain the SE(2) pose of every intermediate frame (or all frames, if you'd like) of the biped; making this output a cell array might be easiest.

This new method will replace last week's fwd_kinematics( … ) method.

2. Add a new property to the Biped class, stance, which will indicate the current reference/stance frame of the biped (eg. it may hold values of 'TORSO', 'LEFT_FOOT' or 'RIGHT_FOOT'). Add a 'setter' method, set_stance( obj, a_stance ) to set this new class property.

3. Update plotTF( obj ) to plot your stick figure biped (and any frames) relative to the current stance frame. The stance frame's spatial pose (eg. torso, left foot or right foot) should be the identity. This method should make use of your new fwd_kinematics( obj, a_ref_frame ) method.

Pick a joint configuration for the biped. Display a new plot of the biped (in that joint configuration) for each case where stance is set to 'TORSO', 'LEFT_FOOT' and 'RIGHT_FOOT'.

4. Add a new method to your Biped class:

animateTrajectory( obj, a_time, a_joint_traj )

a_joint_traj is a 6 x N matrix specifying the trajectory of all 6 joints over N time instants. a_time is the corresponding N-length time vector. This new method should, for each time instant of a_time, compute the biped forward kinematics for the joint values at that time instant and update a stick figure plot of the biped (including plotted biped frames). The end result should be a plot/animation that displays the stick figure biped moving through the specified joint trajectory, a_joint_traj, in sync with time vector, a_time.

Construct a 5-10 second long joint trajectory for your biped. Run this method to play an animation of the biped executing that joint trajectory. Do this for each possible value of stance (ie. 'TORSO', 'LEFT_FOOT', 'RIGHT_FOOT').


Back Main

ece4560/biped/02plotkin.txt · Last modified: 2023/03/06 10:31 by 127.0.0.1