Cheetah Software  1.0
Quadruped.cpp File Reference

Data structure containing parameters for quadruped robot. More...

+ Include dependency graph for Quadruped.cpp:

Go to the source code of this file.

Functions

template<typename T , typename T2 >
Vec3< T > withLegSigns (const Eigen::MatrixBase< T2 > &v, int legID)
 

Detailed Description

Data structure containing parameters for quadruped robot.

This file contains the Quadruped class. This stores all the parameters for a quadruped robot. There are utility functions to generate Quadruped objects for Cheetah 3 (and eventually mini-cheetah). There is a buildModel() method which can be used to create a floating-base dynamics model of the quadruped.

Definition in file Quadruped.cpp.

Function Documentation

template<typename T , typename T2 >
Vec3<T> withLegSigns ( const Eigen::MatrixBase< T2 > &  v,
int  legID 
)

Flip signs of elements of a vector V depending on which leg it belongs to

Definition at line 207 of file Quadruped.cpp.

207  {
208  static_assert(T2::ColsAtCompileTime == 1 && T2::RowsAtCompileTime == 3,
209  "Must have 3x1 matrix");
210  switch (legID) {
211  case 0:
212  return Vec3<T>(v[0], -v[1], v[2]);
213  case 1:
214  return Vec3<T>(v[0], v[1], v[2]);
215  case 2:
216  return Vec3<T>(-v[0], -v[1], v[2]);
217  case 3:
218  return Vec3<T>(-v[0], v[1], v[2]);
219  default:
220  throw std::runtime_error("Invalid leg id!");
221  }
222 }
typename Eigen::Matrix< T, 3, 1 > Vec3
Definition: cppTypes.h:26

+ Here is the caller graph for this function: