Gazebo | Ignition | Community
Ask Your Question
0

Positive Rotation of model is not anticlockwise? why?

asked 2021-05-28 20:27:05 -0600

shiraz_baig gravatar image

updated 2021-06-03 03:45:56 -0600

I am using melodic and ubuntu 18.04 and gazebo-9.
Problem: When I give the command of turning the Yaw (angle around z axis) as a positive value eg (+0.3), the model should rotate anticlockwise (ie towards its left). But it is moving clockwise.
Question: Why, my robot does not rotate anticlockwise, when I give it a positive rotation command?

I downloaded urdf file of a model (two-wheeled robot) from part1 of
this site and added plugin "libgazebo_ros_diff_drive.so"
My launch file is as follows:


<xml version="1.0" encoding="UTF-8"?>
<launch>
    <param name="robot_description" command="$(find xacro)/xacro.py '$(find m2wr_description)/urdf/m2wr_website.urdf'" >

    <arg name="x" default="0"/>
    <arg name="y" default="0"/>
    <arg name="z" default="0.5"/>

    <include file="$(find gazebo_ros)/launch/empty_world.launch">
    </include>

    <node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"          args="-urdf -param robot_description -model m2wr -x $(arg x) -y $(arg y) -z $(arg z)" />
</launch>
 

I am setting rotation of the model from this python script, using topic=cmd_vel and creating a publisher node. I tried to give the code of my script here. But I think, my length exceeds, so I am not including it.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-06-03 03:45:05 -0600

The model defines the right wheel on the left and the left wheel on the right. Swap the sign of the y-position in the wheel joints.

edit flag offensive delete link more

Comments

Thankyou very much. Now, It works fine.

shiraz_baig gravatar imageshiraz_baig ( 2021-06-03 10:52:32 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2021-05-28 20:27:05 -0600

Seen: 149 times

Last updated: Jun 03 '21