| 262 | } |
| 263 | |
| 264 | bool LocalizationNode::GetPoseFromTf(const std::string &target_frame, |
| 265 | const std::string &source_frame, |
| 266 | const ros::Time ×tamp, |
| 267 | Vec3d &pose) |
| 268 | { |
| 269 | tf::Stamped<tf::Pose> ident(tf::Transform(tf::createIdentityQuaternion(), |
| 270 | tf::Vector3(0, 0, 0)), |
| 271 | timestamp, |
| 272 | source_frame); |
| 273 | tf::Stamped<tf::Pose> pose_stamp; |
| 274 | try { |
| 275 | this->tf_listener_ptr_->transformPose(target_frame, |
| 276 | ident, |
| 277 | pose_stamp); |
| 278 | } catch (tf::TransformException &e) { |
| 279 | LOG_ERROR << "Couldn't transform from " |
| 280 | << source_frame |
| 281 | << "to " |
| 282 | << target_frame; |
| 283 | return false; |
| 284 | } |
| 285 | |
| 286 | pose.setZero(); |
| 287 | pose[0] = pose_stamp.getOrigin().x(); |
| 288 | pose[1] = pose_stamp.getOrigin().y(); |
| 289 | double yaw,pitch, roll; |
| 290 | pose_stamp.getBasis().getEulerYPR(yaw, pitch, roll); |
| 291 | pose[2] = yaw; |
| 292 | return true; |
| 293 | } |
| 294 | |
| 295 | void LocalizationNode::TransformLaserscanToBaseFrame(double &angle_min, |
| 296 | double &angle_increment, |
nothing calls this directly
no outgoing calls
no test coverage detected