Skip to content
Snippets Groups Projects
Commit 6a6b9abc authored by Rohan Budhiraja's avatar Rohan Budhiraja
Browse files

[contact-models] cast to newscalar

parent bb349c75
No related branches found
No related tags found
1 merge request!1merge request for simplification
......@@ -149,6 +149,21 @@ namespace pinocchio
}
return -1;
}
/// \returns An expression of *this with the Scalar type casted to NewScalar.
template<typename NewScalar>
RigidContactModelTpl<NewScalar,Options> cast() const
{
typedef RigidContactModelTpl<NewScalar,Options> ReturnType;
ReturnType res;
res.type = type;
res.frame_id = frame_id;
res.reference_frame =reference_frame;
res.desired_contact_placement = desired_contact_placement.template cast<NewScalar>();
res.desired_contact_velocity = desired_contact_velocity.template cast<NewScalar>();
res.desired_contact_acceleration = desired_contact_acceleration.template cast<NewScalar>();
return res;
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment