0
$\begingroup$

Rosanswers logo

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" izz="1.0"/>
    </inertial>
  </link>
  <link name="right_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" izz="1.0"/>
    </inertial>
  </link>
  <joint name="left_front_wheel_hinge" type="continuous">
    <parent link="base_link"/>
    <child link="left_front_wheel"/>
    <axis xyz="0 0 1"/>
    <origin rpy="80.02 0 0" xyz="0.41 0.3 -0.06"/>
  </joint>
  <joint name="right_front_wheel_hinge" type="continuous">
    <parent link="base_link"/>
    <child link="right_front_wheel"/>
    <axis xyz="0 0 1"/>
    <origin rpy="80.02 0 0" xyz="0.41 -0.3 -0.06"/>
  </joint>
  <joint name="left_back_wheel_hinge" type="continuous">
    <parent link="base_link"/>
    <child link="left_back_wheel"/>
    <axis xyz="0 0 1"/>
    <origin rpy="80.02 0 0" xyz="-0.41 0.3 -0.06"/>
  </joint>
  <joint name="right_back_wheel_hinge" type="continuous">
    <parent link="base_link"/>
    <child link="right_back_wheel"/>
    <axis xyz="0 0 1"/>
    <origin rpy="80.02 0 0" xyz="-0.41 -0.3 -0.06"/>
  </joint>
  <gazebo reference="base_link">
    <mu1>10</mu1>
    <mu2>10</mu2>
    <turnGravityOff>true</turnGravityOff>
    <material>Gazebo/Green</material>
  </gazebo>
  <gazebo reference="left_front_wheel">
    <mu1>10</mu1>
    <mu2>10</mu2>
    <turnGravityOff>true</turnGravityOff>
    <material>Gazebo/WoodFloor</material>
  </gazebo>
  <gazebo reference="right_front_wheel">
    <mu1>10</mu1>
    <mu2>10</mu2>
    <turnGravityOff>true</turnGravityOff>
    <material>Gazebo/Blue</material>
  </gazebo>
  <gazebo reference="left_back_wheel">
    <mu1>10</mu1>
    <mu2>10</mu2>
    <turnGravityOff>true</turnGravityOff>
    <material>Gazebo/Blue</material>
  </gazebo>
  <gazebo reference="right_back_wheel">
    <mu1>10</mu1>
    <mu2>10</mu2>
    <turnGravityOff>true</turnGravityOff>
    <material>Gazebo/Blue</material>
  </gazebo>
</robot>

Originally posted by Moataz Elmasry on ROS Answers with karma: 126 on 2011-03-16

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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.


Originally posted by hsu with karma: 5780 on 2011-03-25

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

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.


Originally posted by hsu with karma: 5780 on 2011-03-25

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.