ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

geometry_msgs/Vector3Stamped

asked 2022-08-06 06:27:19 -0500

iimata gravatar image

updated 2022-08-06 06:28:21 -0500

hello,i saw in a public code that they uesd a Vector3Stamped to Publish function for odometry like this


speed_msg.header.stamp = nh.now(); 
  speed_msg.vector.x = speed_act_left; 
  speed_msg.vector.y = speed_act_right; 
  speed_msg.vector.z = time / 10; 
  speed_pub.publish(&speed_msg);
  nh.spinOnce();

The quastion what is the Vector3Stamped and how we can publisth the data for odometry

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-08-07 06:19:37 -0500

ravijoshi gravatar image

The question what is the Vector3Stamped

The geometry_msgs/Vector3Stamped message represents a Vector3 with reference coordinate frame and timestamp. For example, consider your robot moving and publishing its position in 3D as a Vector (x, y, z). This Vector makes sense only when you define a reference coordinate system called a coordinate frame. Because the robot is publishing its position while moving, you need to track the time. Therefore, given 2 Vector3, you simply check their time value to differentiate between them. This time value is called timestamp.

The geometry_msgs/Vector3Stamped.msg is defined as following:

# Header contains reference coordinate frame and timestamp
std_msgs/Header header
geometry_msgs/Vector3 vector

Please feel free to check here.

how we can publish the data for odometry

Publishing odometry information over ROS is generally done using nav_msgs/Odometry.msg. The nav_msgs/Odometry.msg represents an estimate of a position and velocity in free space. Please check here for the message definition. There is an excellent tutorial titled "Publishing Odometry Information over ROS." Please check here to view this tutorial.

edit flag offensive delete link more

Comments

Thanks ravi

iimata gravatar image iimata  ( 2022-08-07 17:03:12 -0500 )edit

You are welcome. If the above post answers your issue, I recommend you to click on the accept button to show that question is solved.

ravijoshi gravatar image ravijoshi  ( 2022-08-07 21:05:26 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-08-06 06:27:19 -0500

Seen: 367 times

Last updated: Aug 07 '22