42 Pose::Pose(
double x,
double y,
double z,
double roll,
double pitch,
double yaw)
44 set(x, y, z, roll, pitch, yaw);
47 Pose &
Pose::set(
double x,
double y,
double z,
double roll,
double pitch,
double yaw)
56 position.x = x, position.y = y, position.z = z;
61 orientation.x = x, orientation.y = y, orientation.z = z, orientation.w = w;
65 double halfYaw = double(yaw) * double(0.5), halfPitch = double(pitch) * double(0.5),
66 halfRoll = double(roll) * double(0.5);
67 double cosYaw = cos(halfYaw), sinYaw = sin(halfYaw), cosPitch = cos(halfPitch), sinPitch = sin(halfPitch),
68 cosRoll = cos(halfRoll), sinRoll = sin(halfRoll);
69 setOrientation(sinRoll * cosPitch * cosYaw - cosRoll * sinPitch * sinYaw,
70 cosRoll * sinPitch * cosYaw + sinRoll * cosPitch * sinYaw,
71 cosRoll * cosPitch * sinYaw - sinRoll * sinPitch * cosYaw,
72 cosRoll * cosPitch * cosYaw + sinRoll * sinPitch * sinYaw);
83 pose->position.x = x, pose->position.y = y, pose->position.z = z;
87 pose->orientation.x = x, pose->orientation.y = y, pose->orientation.z = z, pose->orientation.w = w;
91 double halfYaw = double(yaw) * double(0.5), halfPitch = double(pitch) * double(0.5),
92 halfRoll = double(roll) * double(0.5);
93 double cosYaw = cos(halfYaw), sinYaw = sin(halfYaw), cosPitch = cos(halfPitch), sinPitch = sin(halfPitch),
94 cosRoll = cos(halfRoll), sinRoll = sin(halfRoll);
95 pose->orientation.x = sinRoll * cosPitch * cosYaw - cosRoll * sinPitch * sinYaw;
96 pose->orientation.y = cosRoll * sinPitch * cosYaw + sinRoll * cosPitch * sinYaw;
97 pose->orientation.z = cosRoll * cosPitch * sinYaw - sinRoll * sinPitch * cosYaw;
98 pose->orientation.w = cosRoll * cosPitch * cosYaw + sinRoll * sinPitch * sinYaw;
106 SetPositionXYZ(des, src.position.x, src.position.y, src.position.z);
107 SetOrientation(des, src.orientation.x, src.orientation.y, src.orientation.z, src.orientation.w);
void SetPositionXYZ(geometry_msgs::PosePtr &pose, double x, double y, double z)
void SetRPY(geometry_msgs::PosePtr &pose, double roll, double pitch, double yaw)
Pose & setOrientation(double x, double y, double z, double w)
void Set(geometry_msgs::PosePtr &pose, double x, double y, double z, double roll, double pitch, double yaw)
boost::shared_ptr< Pose > PosePtr
void SetOrientation(geometry_msgs::PosePtr &pose, double x, double y, double z, double w)
Pose & setXYZ(double x, double y, double z)
Pose & setRPY(double roll, double pitch, double yaw)
Pose & set(double x, double y, double z, double roll, double pitch, double yaw)
geometry_msgs::PosePtr create()