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

Missing world fixed frame

asked 2022-12-24 10:23:29 -0500

lectric gravatar image

updated 2022-12-24 10:27:30 -0500

I'm using ROS Noetic and I have built a custom world with AR Tags and a robot. When I try to obtain the robot yaw in order to calculate the position in global coordinates, the tf package just answer world is not a frame. I've tried to implement a joint between base_link and world but an error is presented showing "world" is not defined. I have read that world is a preset of gazebo but it seems to not be defined. Thank you.

 <?xml version="1.0" ?> <robot
 name="ERC22_URDF"
 xmlns:xacro="http://www.ros.org/wiki/xacro">

 <xacro:include filename="$(find
 ERC22_URDF_description)/urdf/materials.xacro"
 /> <xacro:include filename="$(find
 ERC22_URDF_description)/urdf/ERC22_URDF.trans"
 /> <xacro:include filename="$(find
 ERC22_URDF_description)/urdf/ERC22_URDF.gazebo"
 />

 <link name="base_link">   <inertial>
     <origin xyz="0.009312479330910419 0.0008928693179026247 0.4508429285266153" rpy="0 0 0"/>
     <mass value="1.729680238629788"/>
     <inertia ixx="0.122469" iyy="0.093078" izz="0.197526"
 ixy="-5.1e-05" iyz="1.2e-05"
 ixz="0.006038"/>   </inertial>  
 <visual>
     <origin xyz="0 0 0" rpy="0 0 0"/>
     <geometry>
       <mesh filename="package://ERC22_URDF_description/meshes/base_link.stl"
 scale="0.001 0.001 0.001"/>
     </geometry>
     <material name="silver"/>   </visual>   <collision>
     <origin xyz="0 0 0" rpy="0 0 0"/>
     <geometry>
       <mesh filename="package://ERC22_URDF_description/meshes/base_link.stl"
 scale="0.001 0.001 0.001"/>
     </geometry>   </collision> </link>

 <link name="WLF_supp_1">   <inertial>
     <origin xyz="-0.0005722202916380592
 0.04456811672884131 -0.06998013314667545" rpy="0 0 0"/>
     <mass value="0.040963207008450755"/>
     <inertia ixx="0.000114" iyy="9.6e-05" izz="3e-05" ixy="-0.0"
 iyz="1.6e-05" ixz="-1e-06"/>  
 </inertial>   <visual>
     <origin xyz="-0.391355 0.383158 -0.356565" rpy="0 0 0"/>
     <geometry>
       <mesh filename="package://ERC22_URDF_description/meshes/WLF_supp_1.stl"
 scale="0.001 0.001 0.001"/>
     </geometry>
     <material name="silver"/>   </visual>   <collision>
     <origin xyz="-0.391355 0.383158 -0.356565" rpy="0 0 0"/>
     <geometry>
       <mesh filename="package://ERC22_URDF_description/meshes/WLF_supp_1.stl"
 scale="0.001 0.001 0.001"/>
     </geometry>   </collision> </link>

 <link name="Left_leg_double_1">  
 <inertial>
     <origin xyz="-0.017610729784847123 -0.06278452284012215 -0.07487224121996011" rpy="0 0 0"/>
     <mass value="0.1583068780205665"/>
     <inertia ixx="0.00075" iyy="0.003257" izz="0.002638"
 ixy="-0.000164" iyz="-3.5e-05"
 ixz="0.000733"/>   </inertial>  
<visual>
     <origin xyz="0.252653 0.310658 -0.453036" rpy="0 0 0"/>
     <geometry>
       <mesh filename="package://ERC22_URDF_description/meshes/Left_leg_double_1.stl"
 scale="0.001 0.001 0.001"/>
    </geometry>
     <material name="silver"/>   </visual>   <collision>
     <origin xyz="0.252653 0.310658 -0.453036" rpy="0 0 0"/>
     <geometry>
       <mesh filename="package://ERC22_URDF_description/meshes/Left_leg_double_1.stl"
 scale="0.001 0.001 0.001"/>
     </geometry>   </collision> </link>

 <link name="WLB_supp_1">   <inertial>
     <origin xyz="0.0011204573839502796 0.031881968364872504 -0.06607317272822505" rpy="0 0 0"/>
     <mass value="0 ...
(more)
edit retag flag offensive close merge delete

Comments

Please explain at a high level what information you are trying to obtain. The /tf topic may not be the right place to find it. Can you provide a link to your simulation files (e.g. github or a zip file)?

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-12-29 09:18:10 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-12-26 09:07:31 -0500

Mike Scheutzow gravatar image

You should create a new urdf/xacro file that creates a "world" link, then create a fixed joint from world->base_link (or whatever the base link of your robot uses.) Here's an example of how the universal_robot people do it:

https://github.com/ros-industrial/uni...

edit flag offensive delete link more

Comments

Thank you for answering. This robot is a robotic arm which is fixed to the world but mine is a mobile robot. I've tried the solution you mentioned using a "floating" joint but the model collapses to origin.

lectric gravatar image lectric  ( 2022-12-26 13:56:46 -0500 )edit
1

In gazebo, a mobile object is handled differently from an arm. Are you using "spawn_model" to add the robot to the gazebo world?

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-12-27 14:54:15 -0500 )edit

Yes, here i present my gazebo.launch. Nav_task is a custom world

<launch>
  <param name="robot_description" command="$(find xacro)/xacro $(find ERC22_URDF_description)/urdf/ERC22_URDF.xacro"/>
  <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -model ERC22_URDF"/>
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="worlds/Nav_task.world"/>
    <arg name="paused" value="true"/>
    <arg name="use_sim_time" value="true"/>
    <arg name="gui" value="true"/>
    <arg name="headless" value="false"/>
    <arg name="debug" value="false"/>
  </include>
</launch>
lectric gravatar image lectric  ( 2022-12-27 15:13:04 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2022-12-24 10:23:29 -0500

Seen: 187 times

Last updated: Dec 26 '22