ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
2021-08-18 07:49:22 -0500 | received badge | ● Taxonomist |
2013-09-23 06:54:22 -0500 | received badge | ● Famous Question (source) |
2013-07-12 01:31:33 -0500 | received badge | ● Notable Question (source) |
2013-07-11 11:06:16 -0500 | received badge | ● Popular Question (source) |
2013-07-11 07:10:03 -0500 | asked a question | Getting Robot Orientation I am trying to write a program to have a robot follow a square path. I have two primary functions, forwardCommand and turnCommand, for either going straight to a corner of the square or for turning to the next corner. I am writing in C++. My turning function is incomplete, because I cannot get values in my program to have the robot know when to stop its turn and go straight to the next waypoint. headingTo Function: I am having trouble with getting the orientation of the robot to know when it should stop turning. I have an odometry callback to update my robot class' x, y, and theta coordinates from a nav_msgs::Odometry::ConstPtr& named msg. I need to get state.pose[THETA] to access the polar direction the robot faces, so that when state.pose[THETA] is close to heading the robot moves on. The function yawFromQuaternion: When I try to reference state.pose[THETA] it does not update. Can I have some help with the nav_msgs Odometry and pose.pose.orientation? I read some of the other answered questions (How to understand robot orientation from quaternion yaw angle), . I've tried to implement the solutions found there, but I have been unsuccessful. |