When my robot rotates instead of going straight ahead [closed]

asked 2023-03-08 01:56:52 -0500

seul gravatar image

Hello, I am having an issue with my robot's movement. When I publish linear x using the /cmd_vel topic, my robot attempts to turn left. Additionally, when I send an angular z command for left turn, it moves backward, and for right turn, it moves forward, despite my commands being different. This issue suddenly occurred despite there being no changes made to the robot. What steps can I take to resolve this issue?

thank you for reading.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by seul
close date 2023-03-09 22:49:42.644817

Comments

Can you add your /cmd_vel commands in the edit of the question? Can you show us your code? Maybe your input control to the velocities' translation has some issues

ljaniec gravatar image ljaniec  ( 2023-03-08 19:41:28 -0500 )edit

@ljaniec i just commanded rostopic pub /cmd_vel geometry_msgs/msg/Twist "linear: x: 0.1, y: 0.0, z: 0.0 angular: x: 0.0, y: 0.0, z: 0.0" but my robot rotates not going straight ahead

seul gravatar image seul  ( 2023-03-08 22:20:16 -0500 )edit

Can you see the logs? What software is on the side of the robot?

ljaniec gravatar image ljaniec  ( 2023-03-09 07:49:31 -0500 )edit
1

@ljaniec thank you for answering. i solved this. still i don't know why because i used this for long times without any problems, and i didn't change anything... Eventually i changed motor direction settings in my code. i guess my motor firmware upgraded and that maybe changed how it works. i think it doesn't make sense, but i can not find any reasons :)...

seul gravatar image seul  ( 2023-03-09 22:48:38 -0500 )edit