forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rigid_body_loop.cc
25 lines (21 loc) · 1019 Bytes
/
rigid_body_loop.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "drake/multibody/rigid_body_loop.h"
#include "drake/common/autodiff.h"
#include "drake/common/text_logging.h"
template <typename T>
RigidBodyLoop<T>::RigidBodyLoop(std::shared_ptr<RigidBodyFrame<T>> frameA,
std::shared_ptr<RigidBodyFrame<T>> frameB,
const Eigen::Vector3d& axis)
: frameA_(frameA), frameB_(frameB), axis_(axis) {}
std::ostream& operator<<(std::ostream& os, const RigidBodyLoop<double>& obj) {
os << "loop connects pt "
<< obj.frameA_->get_transform_to_body().matrix().topRightCorner(3, 1)
.transpose()
<< " on " << obj.frameA_->get_rigid_body().get_name() << " to pt "
<< obj.frameB_->get_transform_to_body().matrix().topRightCorner(3, 1)
.transpose()
<< " on " << obj.frameB_->get_rigid_body().get_name() << std::endl;
return os;
}
// Explicitly instantiates on the most common scalar types.
template class RigidBodyLoop<double>;
template class RigidBodyLoop<drake::AutoDiffXd>;