RobAIR-TP-Sources issueshttps://gricad-gitlab.univ-grenoble-alpes.fr/boulayen/robair-tp-sources/-/issues2023-03-20T17:16:26+01:00https://gricad-gitlab.univ-grenoble-alpes.fr/boulayen/robair-tp-sources/-/issues/3Misleading #define statements in action_node and rotation_node2023-03-20T17:16:26+01:00Philip ScalesMisleading #define statements in action_node and rotation_nodeSome #define statements include math operators but have no parentheses, so with a define like below we can have some issues. For example:
`#define rotation_speed_max M_PI/6`
. Pre-processor will replace `rotation_speed_max` with `M_PI/6...Some #define statements include math operators but have no parentheses, so with a define like below we can have some issues. For example:
`#define rotation_speed_max M_PI/6`
. Pre-processor will replace `rotation_speed_max` with `M_PI/6`, so if you use that variable in some computation, it may not do what you initially think:
```
#define rotation_speed_max M_PI/6
...
float rotation_speed = some_value;
float myvar = rotation_speed / rotation_speed_max;
```
after pre-processor:
`float myvar = rotation_speed / M_PI/6;`
So it computes it following usual operator priority, so it computes (rotation_speed / M_PI) / 6 , probably NOT what we were expecting when writing that define.
Suggestion: change all such defines by adding parentheses around them, and make them ALL CAPS to remember they're defines:
`#define ROTATION_SPEED_MAX (M_PI/6)`https://gricad-gitlab.univ-grenoble-alpes.fr/boulayen/robair-tp-sources/-/issues/2Typo in follow_me/detection_node2022-03-16T19:38:17+01:00Belal HmedanTypo in follow_me/detection_nodeThere is a misleading typo in this [line](https://gricad-gitlab.univ-grenoble-alpes.fr/boulayen/robair-tp-sources/-/blob/main/follow_me/src/detection_node.cpp#L461), `//we update moving_person_tracked and publish it` should be replaced ...There is a misleading typo in this [line](https://gricad-gitlab.univ-grenoble-alpes.fr/boulayen/robair-tp-sources/-/blob/main/follow_me/src/detection_node.cpp#L461), `//we update moving_person_tracked and publish it` should be replaced by `//we update moving_person_detected and publish it` as there is no `moving_person_tracked` in the **detection_node.cpp** script.https://gricad-gitlab.univ-grenoble-alpes.fr/boulayen/robair-tp-sources/-/issues/1tutorial_ros robot_moving_node is missing2022-03-09T10:19:15+01:00Belal Hmedantutorial_ros robot_moving_node is missingThe first Lab [tutorial_ros](https://lig-membres.imag.fr/aycard/html/Enseignement/M1/Robotics/Labs/LabROS/TutorialROS/tutorial_ros.pdf) requires a node to publish the [robot_moving](https://gricad-gitlab.univ-grenoble-alpes.fr/boulayen/r...The first Lab [tutorial_ros](https://lig-membres.imag.fr/aycard/html/Enseignement/M1/Robotics/Labs/LabROS/TutorialROS/tutorial_ros.pdf) requires a node to publish the [robot_moving](https://gricad-gitlab.univ-grenoble-alpes.fr/boulayen/robair-tp-sources/-/blob/main/tutorial_ros/src/detect_motion_node.cpp#L52) topic in order to detect the motion.