I'm not able to launch my robot on arena in gazebo.. ros-melodic

asked 2021-02-22 06:45:24 -0600

rk7084 gravatar image

updated 2021-02-24 21:09:56 -0600


I want to launch my robot on an arena in gazebo simulation. I had launched the robot and the arena in the simulation, but the problem which I am facing is the arena is being launched on top of the robot instead of launching the other way around which is robot on arena at a particular location. 
This is my launch file code:

<?xml version="1.0" encoding="UTF-8"?>
    <include file="$(find gazebo_ros)/launch/empty_world.launch"/>
    <param name="robot_description" command="cat '$(find beginner_tutorials)/urdf/arena.urdf'" />
    <include file="$(find beginner_tutorials)/launch/my_robot.launch"/>
  <arg name="yaw" default="0"/>
  <arg name="pitch" default="0"/>
  <arg name="roll" default="-90"/>
  <arg name="x" default="6"/>
  <arg name="y" default="6.5"/>
  <arg name="z" default="0"/>
    <node name="arena" pkg="gazebo_ros" type="spawn_model" output="screen"
        args="-file $(find beginner_tutorials)/urdf/arena.urdf -urdf -model arena -Y $(arg yaw) -P $(arg pitch) -R 
$(arg roll) -x $(arg x) -y $(arg y) -z $(arg z)"/>

Please help me to solve this problem.
Thank you.
edit retag flag offensive close merge delete


Can you attach an image for the same?

skpro19 gravatar image skpro19  ( 2021-02-23 01:41:39 -0600 )edit

Sorry the problem is from my side. I cannot upload a file since I don't have 5 points in my account yet. Thank you though.

rk7084 gravatar image rk7084  ( 2021-02-24 06:33:16 -0600 )edit

You can upload an image somewhere else and paste the link to the image. Also, did you manage to solve the issue at hand?

skpro19 gravatar image skpro19  ( 2021-02-24 09:42:16 -0600 )edit


Still trying to figure out..!

rk7084 gravatar image rk7084  ( 2021-02-24 10:57:23 -0600 )edit
  1. Can you please format your code properly? Tip - Select the entire block and press Ctrl + K.
  2. Try experimenting with the values of the yaw, pitch, roll arguments being passed to arena node. For starters, can you try setting the value of the roll argument to 0.
skpro19 gravatar image skpro19  ( 2021-02-24 13:58:51 -0600 )edit

1) Done. (thank you)

2) The yaw,pitch and roll has something to do, when I set all the values as 0 for r p y the arena first launches vertically and then falls (lands horizontal) due to its weight.

Please have a look. https://drive.google.com/file/d/1h99V...

rk7084 gravatar image rk7084  ( 2021-02-24 21:16:27 -0600 )edit

I think it's trying to make sense now. I had changed to value of "z" in my_robot.launch file thinking that the arena should be already on the surface when my robot launches. So far it seems to be working and will check again after upgrading my robot.

Thank you.

rk7084 gravatar image rk7084  ( 2021-02-24 22:28:15 -0600 )edit