Go to the documentation of this file.
    2 from pathlib 
import Path
 
    5 import pinocchio 
as pin
 
    6 from test_case 
import PinocchioTestCase
 
   11         self.
model = pin.buildSampleModelHumanoidRandom()
 
   13             self.
model.getJointId(
"rarm2_joint")
 
   14             if self.
model.existJointName(
"rarm2_joint")
 
   15             else (self.
model.njoints - 1)
 
   37         f.type = pin.FrameType.BODY
 
   38         self.assertTrue(f.type == pin.FrameType.BODY)
 
   43         f.name = 
"new_hip_frame" 
   44         self.assertTrue(f.name == 
"new_hip_frame")
 
   48         self.assertTrue(f.parentJoint == self.
parent_idx)
 
   50         f.parentJoint = newparent
 
   51         self.assertTrue(f.parentJoint == newparent)
 
   58         new_placement = pin.SE3.Random()
 
   59         f.placement = new_placement
 
   60         self.assertTrue(np.allclose(f.placement.homogeneous, new_placement.homogeneous))
 
   64         frame1 = 
pin.Frame(
"name", 1, 2, M, pin.OP_FRAME)
 
   65         frame2 = 
pin.Frame(
"name", 1, 2, M, pin.OP_FRAME)
 
   66         frame3 = 
pin.Frame(
"othername", 3, 4, pin.SE3.Random(), pin.BODY)
 
   68         self.assertTrue(frame1 == frame2)
 
   69         self.assertFalse(frame1 != frame2)
 
   70         self.assertTrue(frame1 != frame3)
 
   71         self.assertFalse(frame1 == frame3)
 
   76         frame = 
pin.Frame(
"name", 1, 2, pin.SE3.Random(), pin.OP_FRAME)
 
   77         filename = Path(
"frame.pickle")
 
   78         with filename.open(
"wb") 
as f:
 
   81         with filename.open(
"rb") 
as f:
 
   82             frame_copy = pickle.load(f)
 
   84         self.assertEqual(frame, frame_copy)
 
   89         v = np.random.rand(self.
model.nv)
 
   90         a = np.random.rand(self.
model.nv)
 
  107             self.
model, data, self.
frame_idx, pin.ReferenceFrame.LOCAL_WORLD_ALIGNED
 
  127             self.
model, data, self.
frame_idx, pin.ReferenceFrame.LOCAL_WORLD_ALIGNED
 
  144             self.
model, data, self.
frame_idx, pin.ReferenceFrame.LOCAL_WORLD_ALIGNED
 
  149         data = model.createData()
 
  152         v = np.random.rand(model.nv)
 
  159         data2 = model.createData()
 
  165         dJ1 = pin.frameJacobianTimeVariation(model, data, q, v, frame_id, pin.LOCAL)
 
  167         data3 = model.createData()
 
  174 if __name__ == 
"__main__":
 
  
static void act(const Eigen::MatrixBase< Mat > &iV, const ForceDense< ForceDerived > &f, Eigen::MatrixBase< MatRet > const &jF)
Action of a motion set on a force object. The input motion set is represented by a 6xN matrix whose e...
MotionTpl< Scalar, Options > getFrameClassicalAcceleration(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const FrameIndex frame_id, const ReferenceFrame rf=LOCAL)
Returns the "classical" acceleration of the Frame expressed in the desired reference frame....
void randomConfiguration(const LieGroupGenericTpl< LieGroupCollection > &lg, const Eigen::MatrixBase< ConfigL_t > &q0, const Eigen::MatrixBase< ConfigR_t > &q1, const Eigen::MatrixBase< ConfigOut_t > &qout)
MotionTpl< Scalar, Options > getFrameAcceleration(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const FrameIndex frame_id, const ReferenceFrame rf=LOCAL)
Returns the spatial acceleration of the Frame expressed in the desired reference frame....
const DataTpl< Scalar, Options, JointCollectionTpl >::Matrix6x & computeJointJacobiansTimeVariation(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType > &v)
Computes the full model Jacobian variations with respect to time. It corresponds to dJ/dt which depen...
void forwardKinematics(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType1 > &v, const Eigen::MatrixBase< TangentVectorType2 > &a)
Update the joint placements, spatial velocities and spatial accelerations according to the current jo...
def test_type_get_set(self)
A Plucker coordinate frame attached to a parent joint inside a kinematic tree.
def test_frame_equality(self)
def test_name_get_set(self)
MotionTpl< Scalar, Options > getFrameVelocity(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const FrameIndex frame_id, const ReferenceFrame rf=LOCAL)
Returns the spatial velocity of the Frame expressed in the desired reference frame....
ConstraintDataTpl< Scalar, Options, ConstraintCollectionTpl > createData(const ConstraintModelTpl< Scalar, Options, ConstraintCollectionTpl > &cmodel)
def test_placement_get_set(self)
def assertApprox(self, a, b, eps=1e-6)
void computeFrameJacobian(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const FrameIndex frame_id, const Eigen::MatrixBase< Matrix6xLike > &J)
Computes the Jacobian of a specific Frame expressed in the LOCAL frame coordinate system.
Eigen::Matrix< typename LieGroupCollection::Scalar, Eigen::Dynamic, 1, LieGroupCollection::Options > neutral(const LieGroupGenericTpl< LieGroupCollection > &lg)
Visit a LieGroupVariant to get the neutral element of it.
const DataTpl< Scalar, Options, JointCollectionTpl >::Matrix6x & computeJointJacobians(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data)
Computes the full model Jacobian, i.e. the stack of all motion subspace expressed in the world frame....
Eigen::Matrix< Scalar, 6, Eigen::Dynamic, Options > getFrameJacobian(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const FrameIndex frame_id, const ReferenceFrame reference_frame)
Returns the jacobian of the frame expressed either expressed in the local frame coordinate system,...
void getFrameJacobianTimeVariation(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const FrameIndex frame_id, const ReferenceFrame rf, const Eigen::MatrixBase< Matrix6xLike > &dJ)
Computes the Jacobian time variation of a specific frame (given by frame_id) expressed either in the ...
def test_parent_get_set(self)
def test_frame_algo(self)
const DataTpl< Scalar, Options, JointCollectionTpl >::SE3 & updateFramePlacement(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const FrameIndex frame_id)
Updates the placement of the given frame.
pinocchio
Author(s): 
autogenerated on Wed May 28 2025 02:41:14