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