How to set initial orientation for /odom and /base_footprint?

asked 2020-05-07 07:58:49 -0500

Yehor gravatar image

Hello,

Could someone help me with my issue. I have build my custom robot,however the initial orientation of my /odom frame is wrong. It is rotated for 180 degrees. Is it possible somehow to choose the initial x direction of the frame?

Thank you

edit retag flag offensive close merge delete

Comments

Standard ros cooridinate system is x = forward, y = left (seen from standing behing; port side), and angular-z is left turn, negative values are the opposite. Is your urdf oriented/build this way?

Dragonslayer gravatar image Dragonslayer  ( 2020-05-07 08:06:08 -0500 )edit

I don't have any urdf for know. I just launching my driver node, which posts odometry

Yehor gravatar image Yehor  ( 2020-05-07 08:09:17 -0500 )edit

what are the data ur feeding to Odom examples like wheel Odom, imu, GPS and initial x-direction will start from 0

Nitesh_j gravatar image Nitesh_j  ( 2020-05-07 08:09:47 -0500 )edit

@Nitesh_j I feed wheel Odom, when the robot started it receives 0 from encoders.

I can't understand what do you mean with initial x-direction? The question is that the initial x-direction is rotated((

Yehor gravatar image Yehor  ( 2020-05-07 08:16:09 -0500 )edit

How can 0 be "rotated"? If your robot/encoders moves forward does x increment or decrement? Maybe you could post a picture of some sort.

Dragonslayer gravatar image Dragonslayer  ( 2020-05-07 08:26:38 -0500 )edit

Sorry, the problem is related to my https://answers.ros.org/question/3517... question.

I rotated lidar with static_transform_publisher, because it is mounted with opposite x direction. And now the x direction of odom is okay and the x direction of laser_frame is opposite to odom.

I it is difficult for me to understand it because I don't see laser msg with odom fixed frame.

Yehor gravatar image Yehor  ( 2020-05-07 08:29:59 -0500 )edit

@ Dragonslayer I understand what is the problem, I rotated lidar frame with respect to base_footprint. However, I still can't check lidar msg with fixed frame base_footprint or odom

Yehor gravatar image Yehor  ( 2020-05-07 08:37:02 -0500 )edit