56 auto now = std::chrono::steady_clock::now();
57 double dt = std::chrono::duration<double>(now -
lastUpdateTime_).count();
63 float sinT = std::sin(
t_);
64 float cosT = std::cos(
t_);
65 float denom = 1.0f + sinT * sinT;
67 float localX =
size_ * cosT / denom;
68 float localY =
size_ * sinT * cosT / denom;
73 float x =
centerX_ + localX * ch - localY * sh;
74 float y =
centerY_ + localX * sh + localY * ch;
78 float sinT2 = sinT * sinT;
79 float cosT2 = cosT * cosT;
80 float denom2 = denom * denom;
81 float dxdt =
size_ * (-sinT * (1.0f + sinT2) - cosT * 2.0f * sinT * cosT) / denom2;
83 size_ * ((cosT2 - sinT2) * (1.0f + sinT2) - sinT * cosT * 2.0f * sinT * cosT) / denom2;
84 float yaw = std::atan2(dydt, dxdt) +
heading_;
89 float requiredT =
static_cast<float>(
static_cast<float>(
numLoops_) * 2.0f * M_PI);
92 RCLCPP_INFO(
getLogger(),
"CbFigureEight: %d loops completed - posting success",
numLoops_);