Home | Tutorials | Wiki | Issues
Ask Your Question
0

Velocity Instantaneously x Velocity With Joint Motors and How to Use

asked 2017-12-11 19:04:20 -0600

schulze_18 gravatar image

Hi everyone,

I'm trying to control the height of a UAV using predictive control. To do so I'm using the "Iris with Standoff" model, but I'm having some trouble to set the velocity of the rotor's joint. I followed the tutorial "Setting Velocity on Links And Joints" (http://gazebosim.org/tutorials?tut=se...) and tried to use the "Set Velocity Instantaneously", but the UAV doesn't take off, independent of the velocity that I set, even though the rotors rotate. It seems to me, that I should set the velocity with joint motors, but I didn't understand how to use. I can't set the velocity using PID Controllers, because that is already in my controller. I'm setting the velocity with a plugin that is subscribed in a ROS Topic, all the "ROS Thing" is working, I followed the velodyne tutorial (http://gazebosim.org/tutorials?tut=gu...). So, in my situation, how should I set the velocity? Instantaneously or with joint motors? And how can I do this?

I'm using Gazebo7, ROS Kinetic and Ubuntu 16.04.

The model.sdf and the plugin that i developed are below. Sorry if the post is too big, it is because of the models and plugins code, first time here.

Mode.sdf

<?xml version='1.0'?>
<sdf version='1.6'>
  <model name='iris'>
    <pose>0 0 0.194923 0 0 0</pose>
    <link name='base_link'>
      <velocity_decay>
        <linear>0.0</linear>
        <angular>0.0</angular>
      </velocity_decay>
      <inertial>
        <pose>0 0 0 0 0 0</pose>
        <mass>0.468</mass>
        <inertia>
          <ixx>0.004856</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>0.004856</iyy>
          <iyz>0</iyz>
          <izz>0.008801</izz>
        </inertia>
      </inertial>
      <collision name='base_link_collision'>
        <pose>0 0 -0.08 0 0 0</pose>
        <geometry>
          <box>
            <size>0.47 0.47 0.23</size>
          </box>
        </geometry>
        <surface>
          <contact>
            <ode>
              <max_vel>100.0</max_vel>
              <min_depth>0.001</min_depth>
            </ode>
          </contact>
          <friction>
            <ode>
              <mu>1.0</mu>
              <mu2>1.0</mu2>
            </ode>
          </friction>
        </surface>
      </collision>
      <visual name='base_link_visual'>
        <geometry>
          <mesh>
            <uri>model://iris_with_standoffs/meshes/iris.dae</uri>
          </mesh>
        </geometry>
        <material>
          <script>
            <name>Gazebo/DarkGrey</name>
          </script>
        </material>
      </visual>

      <visual name='front_left_leg_visual'>
        <pose>0.123 0.22 -0.11 0 0 0</pose>
        <geometry>
          <cylinder>
            <radius>0.005</radius>
            <length>0.17</length>
          </cylinder>
        </geometry>
        <material>
          <script>
            <name>Gazebo/FlatBlack</name>
            <uri>file://media/materials/scripts/gazebo.material</uri>
          </script>
        </material>
      </visual>
      <visual name='front_right_leg_visual'>
        <pose>0.123 -0.22 -0.11 0 0 0</pose>
        <geometry>
          <cylinder>
            <radius>0.005</radius>
            <length>0.17</length>
          </cylinder>
        </geometry>
        <material>
          <script>
            <name>Gazebo/FlatBlack</name>
            <uri>file://media/materials/scripts/gazebo.material</uri>
          </script>
        </material>
      </visual>
      <visual name='rear_left_leg_visual'>
        <pose>-0.140 0.21 -0.11 0 0 0</pose>
        <geometry>
          <cylinder>
            <radius>0.005</radius>
            <length>0.17</length>
          </cylinder>
        </geometry>
        <material>
          <script>
            <name>Gazebo/FlatBlack</name>
            <uri>file://media/materials/scripts/gazebo.material</uri>
          </script>
        </material>
      </visual>
      <visual name='rear_right_leg_visual'>
        <pose>-0.140 -0.21 -0.11 0 ...
(more)
edit retag flag offensive close merge delete

Comments

Hi boy, have you solved the problem?

luxiaojun gravatar imageluxiaojun ( 2018-05-01 07:09:42 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-11-09 07:12:19 -0600

schulze_18 gravatar image

updated 2019-11-09 07:21:05 -0600

Hi, Velocity Instantaneously will only work for one step of the simulation, because of that you need to set this velocity every step of the simulation.

About the UAV not taking off, I can be wrong, but after a lot of reading, I realize that Gazebo does not simulate aerodynamics effects (you need to use a additional plugin for that), and without that the rotor's velocity will not produce any force. The simple solution was developing a plugin that apply on each rotors a force proportional to the velocity. Here is some lines of my plugin:

thrust_force.Set(0,0,k*vel[0]*vel[0]);      
this->model->GetLinks()[3]->AddRelativeForce(thrust_force);

where "k" is the thrust coefficient related to the rotor's blade. Here is the full plugin(link)

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

2 followers

Stats

Asked: 2017-12-11 19:04:20 -0600

Seen: 557 times

Last updated: Nov 09