MCPcopy Create free account
hub / github.com/RoboMaster/RoboRTS / DetectMovement

Method DetectMovement

roborts_costmap/src/costmap_interface.cpp:192–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192void CostmapInterface::DetectMovement(const ros::TimerEvent &event) {
193 tf::Stamped<tf::Pose> new_pose;
194 if (!GetRobotPose(new_pose)) {
195 robot_stopped_ = false;
196 } else if (fabs((old_pose_.getOrigin() - new_pose.getOrigin()).length()) < 1e-3 \
197 && fabs(old_pose_.getRotation().angle(new_pose.getRotation())) < 1e-3) {
198 old_pose_ = new_pose;
199 robot_stopped_ = true;
200 } else {
201 old_pose_ = new_pose;
202 robot_stopped_ = false;
203 }
204}
205
206void CostmapInterface::MapUpdateLoop(double frequency) {
207 if (frequency <= 0.0) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected