iRobotEducation / irobot_create_msgs

Action, message and service definitions used by the iRobot® Create® Platform
BSD 3-Clause "New" or "Revised" License
30 stars 8 forks source link

Question on Odometry topic #12

Closed JonathanNash21 closed 1 year ago

JonathanNash21 commented 1 year ago

Hello. I'm currently working on an aggregation tool for multiple CNNs looking at objects around a room, with the cameras/computers running the CNNs being mounted on a create3 as a mobile robot. In order to determine if two cameras (and thus, robots) are looking roughly at the same object, I need to know the position and orientation of each robot.

I know I can see this using /{namespace}/odom (or maybe imu, the other topics don't seem to be as useful for this case), but I'm not exactly sure what I'm getting in terms of units of measurement and what some of the values are. For example: Screenshot from 2022-10-25 19-03-19 Screenshot from 2022-10-25 19-03-47 The first screen shot is my "initial position" (after moving around a decent bit from the dock. Since that's where it turns on), and the second is after I run three backwards drive-arcs (two clockwise and one counterclockwise, using the teleop-keyboard command). I'm really just wondering:

A. what units of measure are being used, particularly for the position values. Are they in meters? I'm assuming the orientation units are radians.

B. What is orientation.w? I assume that the x, y, and z values are rotations about their respective unit vectors (using a right hand rule) and thus correspond to the robot's roll, pitch, and yaw.

C. How is the robot's local coordinate frame initialized? I'm not sure it's based off of the dock/other starting point, as I would expect the values shown in the screenshots to be vastly different if this were true (the robot always stayed on the y and -x axis for the dock being the initialization point, assuming that the coordinate frame is oriented in the direction the robot is initially facing).

Thank you.

shamlian commented 1 year ago

The rather terse ROS 2 docs are here. The standard Pose message uses a Point which has position in meters in X, Y, and Z, and the orientation as a Quaternion, where x, y, and z are the imaginary components, and w is the real component. These do not correspond to Euler angles (roll, pitch, yaw).

The robot starts at (0, 0, 0) in xyz space and (0, 0, 0) in roll-pitch-yaw at boot. If you want to reset the robot's position, use the ResetPose service (see https://github.com/iRobotEducation/create3_docs/discussions/81 for some caveats).