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

Warn: gazebo ApplyBodyWrench: reference frame not implemented yet

asked 2011-03-16 00:31:47 -0500

Moataz Elmasry gravatar image

updated 2011-03-26 13:14:22 -0500

tfoote gravatar image

Hello List

I'm a newbie to Gazebo and have been experimenting with it for the last couple of days. So now I have a small problem, I wrote a simple 4 wheels robot (attached to this email) which spawns perfectly in gazebo. Now whenever I apply a body wrench, I get the following warning in Gazebo "[ WARN] [1299848525.581625793, 11872.099000000]: ApplyBodyWrench: reference frame and reference_point not implemented yet, force is defined and applied at the body frame"

rosservice call gazebo/apply_body_wrench '{body_name: "car::left_front_wheel" , wrench: { force: { x: 0.1, y: 0, z: 0 } , torque: { x: 0.0, y: 0 , z: 0 } }, start_time: 10000000000, duration: 1000000000 }'

The car moves actually the way I want, but it I'd understande from that warning that the force is applied to the base_link and not to the wheel the way I want. Or did I miss something?

Thanks alot for the help Best regards Moataz

wheels_robot4.urdf

<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- |    This document was autogenerated by xacro from wheels_robot4.xacro            | -->
<!-- |    EDITING THIS FILE BY HAND IS NOT RECOMMENDED                                 | -->
<!-- =================================================================================== -->
<robot name="wheels_robot" xmlns:body="http://playerstage.sourceforge.net/gazebo/xmlschema/#body" xmlns:geom="http://playerstage.sourceforge.net/gazebo/xmlschema/#geom" xmlns:joint="http://playerstage.sourceforge.net/gazebo/xmlschema/#joint" xmlns:model="http://playerstage.sourceforge.net/gazebo/xmlschema/#model" xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor" xmlns:visual="http://playerstage.sourceforge.net/gazebo/xmlschema/#visual" xmlns:xacro="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface">
  <link name="base_link">
    <inertial>
      <mass value="1"/>
      <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
    </inertial>
    <visual>
      <geometry>
        <box size="1 0.6 0.1"/>
      </geometry>
    </visual>
    <collision>
      <geometry>
        <box size="1 0.6 0.1"/>
      </geometry>
    </collision>
  </link>
  <link name="left_front_wheel">
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <cylinder length="0.11" radius="0.096"/>
      </geometry>
      <material name="Cyan1">
        <color rgba="0 1 1 1.0"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <cylinder length="0.11" radius="0.096"/>
      </geometry>
    </collision>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
    </inertial>
  </link>
  <link name="right_front_wheel">
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <cylinder length="0.11" radius="0.096"/>
      </geometry>
      <material name="Cyan1">
        <color rgba="0 1 1 1.0"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <cylinder length="0.11" radius="0.096"/>
      </geometry>
    </collision>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
    </inertial>
  </link>
  <link name="left_back_wheel">
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <cylinder length="0.11" radius="0.096"/>
      </geometry>
      <material name="Cyan1">
        <color rgba="0 1 1 1.0"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <cylinder length="0.11" radius="0.096"/>
      </geometry>
    </collision>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0 ...
(more)
edit retag flag offensive close merge delete

4 Answers

Sort by » oldest newest most voted
1

answered 2011-03-25 13:01:46 -0500

hsu gravatar image

updated 2011-03-26 13:14:59 -0500

tfoote gravatar image

implemented in trunk, please see r36485. Now you can apply a wrench on body1 where the wrench is defined in body2 frame. If the 2 frames are moving relative to each other, only the initial relative pose are used.

edit flag offensive delete link more
1

answered 2011-03-25 05:45:46 -0500

hsu gravatar image

updated 2011-03-28 07:26:17 -0500

Hi, the service call you made applied the wrench on the correct body "car::left_front_wheel" correctly as you described above.

The warning applies only if a "reference_frame" different than the "body_name" is supplied. For example, if a "reference_frame" is added to your service call that is different than "car::left_front_wheel":

rosservice call gazebo/apply_body_wrench '{reference_frame: "car::base_link", body_name: "car::left_front_wheel" , wrench: { force: { x: 0.1, y: 0, z: 0 } , torque: { x: 0.0, y: 0 , z: 0 } }, start_time: 10000000000, duration: 1000000000 }'

The service call will still apply the specified wrench to "car::left_front_wheel" correctly, the warning pertains to the reference frame of the wrench is now erroneously located at "car::left_front_wheel", not the desired "car::base_link".

hope this makes sense.

the patch is in r36485 as mentioned above.

edit flag offensive delete link more
0

answered 2011-03-16 01:48:08 -0500

Moataz Elmasry gravatar image

Sorry, couldn´t upload the code here (No enough Karma) so here it is uploaded to paste.org

With the reference_frame, it looks like one has to define the origin in origin and collision, although its said the identity vector will be used if not defined, I'll come back later regarding this point. many Thanks

edit flag offensive delete link more

Comments

Everything is ok now. I looked into the gazebo code. This warning is issued in all cases and force is applied to links the way I wanted. Thanks
Moataz Elmasry gravatar image Moataz Elmasry  ( 2011-03-17 21:57:52 -0500 )edit
0

answered 2011-03-16 00:50:43 -0500

mbj gravatar image

Please, can you upload the code to we can download them? This copy-pasted code is unreadable!

Thanks!

edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-03-16 00:31:47 -0500

Seen: 1,248 times

Last updated: Mar 28 '11