This package define 4 main classes representing physical concepts of legged locomotion. Contact Model, Contact Patch, Contact Phase and Contact Sequence.
A Contact Model define the physical properties of a contact. A Contact Patch define completely a contact between a part of the robot and the environment, it contain a Contact Model. A Contact Phase is defined by a constant set of contacts, it contains one or more Contact Patches. Finally, a Contact Sequence is a sequence of Contact Phases.
### Contact Model
A Contact Model define the physical properties of a contact: the type of contact (Planar or Point), the physical positions of the contact points with respect to the "center" of the contact, and the coefficient of friction for this contact.
The default constructor create a ContactModel with "undefined" values. Other constructors exist to build a ContactModel with a friction coefficient or a contact type:
%% Cell type:code id: tags:
``` python
cm1=ContactModel(0.5)
print("cm1 friction coefficient:",cm1.mu)
cm2=ContactModel(0.9,ContactType.CONTACT_POINT)
print("cm2 Contact Type: ",cm2.contact_type)
print("cm2 friction coefficient:",cm2.mu)
print("cm2 number of contact points: ",cm2.num_contact_points)
print("cm2 contact point position: ",cm2.contact_points_positions)
```
%%%% Output: stream
cm1 friction coefficient: 0.5
cm2 Contact Type: CONTACT_POINT
cm2 friction coefficient: 0.9
cm2 number of contact points: 1
cm2 contact point position: [0. 0. 0.]
%% Cell type:markdown id: tags:
The contact point position are expressed in the contact frame (see the next section for more details). By default they are positionned at the origin. It is also possible to create contact model for planar contacts, and define the contacts positions at the corners of a rectangular feet:
This package define 4 main classes representing physical concepts of legged locomotion. Contact Model, Contact Patch, Contact Phase and Contact Sequence.
A Contact Model define the physical properties of a contact. A Contact Patch define completely a contact between a part of the robot and the environment, it contain a Contact Model. A Contact Phase is defined by a constant set of contacts, it contains one or more Contact Patches. Finally, a Contact Sequence is a sequence of Contact Phases.
### Contact Model
A Contact Model define the physical properties of a contact: the type of contact (Planar or Point), the physical positions of the contact points with respect to the "center" of the contact, and the coefficient of friction for this contact.
The default constructor create a ContactModel with "undefined" values. Other constructors exist to build a ContactModel with a friction coefficient or a contact type:
%% Cell type:code id: tags:
``` python
cm1=ContactModel(0.5)
print("cm1 friction coefficient:",cm1.mu)
cm2=ContactModel(0.9,ContactType.CONTACT_POINT)
print("cm2 Contact Type: ",cm2.contact_type)
print("cm2 friction coefficient:",cm2.mu)
print("cm2 number of contact points: ",cm2.num_contact_points)
print("cm2 contact point position: ",cm2.contact_points_positions)
```
%%%% Output: stream
cm1 friction coefficient: 0.5
cm2 Contact Type: CONTACT_POINT
cm2 friction coefficient: 0.9
cm2 number of contact points: 1
cm2 contact point position: [0. 0. 0.]
%% Cell type:markdown id: tags:
The contact point position are expressed in the contact frame (see the next section for more details). By default they are positionned at the origin. It is also possible to create contact model for planar contacts and define the contacts positions at the corners of a rectangular feet:
# define 4 contacts points at the corners of a rectangle:
cm_planar.num_contact_points=4
lx=0.2/2.# half size of the feet along x axis
ly=0.13/2.# half size of the feet along y axis
contact_points=np.zeros([3,4])
contact_points[0,:]=[-lx,-lx,lx,lx]
contact_points[1,:]=[-ly,ly,-ly,ly]
cm_planar.contact_points_positions=contact_points
# print the contact model data:
print("cm_planar: ",cm_planar)
```
%%%% Output: stream
cm_planar: ContactType: 1, mu: 0.5
Number of contact points: 4, positions:
-0.1 -0.1 0.1 0.1
-0.065 0.065 -0.065 0.065
0 0 0 0
%% Cell type:markdown id: tags:
### Contact Patch
A contact patch define the placement (in SE(3), in the world frame) of a contact between a part of the robot and the environment. It contains a ContactModel.