MCPcopy Create free account
hub / github.com/RoboJackets/software-training / StateFromMsg

Function StateFromMsg

controllers/src/controller_helpers.h:11–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9namespace controllers {
10
11 inline Eigen::Vector3d StateFromMsg(const geometry_msgs::msg::PoseStamped & pose)
12 {
13 Eigen::Quaterniond orientation;
14 tf2::fromMsg(pose.pose.orientation, orientation);
15 Eigen::Vector3d state;
16 state << pose.pose.position.x, pose.pose.position.y,
17 orientation.toRotationMatrix().eulerAngles(0, 1, 2)[2];
18 return state;
19 }
20
21}
22

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected