Home | Tutorials | Wiki | Issues
Ask Your Question

lugd1229's profile - activity

2016-02-11 05:03:46 -0500 received badge  Nice Question (source)
2015-10-31 12:31:06 -0500 marked best answer How to animate a hand using a plugin

I use a plugin to control a hand model with two fingers from a position(0,0,0) to a high position(0,0,0.5), and the model will quiver up and down. The motion is not regular and not smooth, would you please help me? thank you

world file:

<plugin name="animate_pose1" filename="libanimate_pose1.so"/>

the animate_pose.cc:

  gazebo::common::PoseAnimationPtr anim(
      new gazebo::common::PoseAnimation("box::my_joint5", 10.0, 0));

  gazebo::common::PoseKeyFrame *key = anim->CreateKeyFrame(0.0);
  key = anim->CreateKeyFrame(0);
  key->SetTranslation(math::Vector3(0, 0, 0));
  key = anim->CreateKeyFrame(2.0);
  key->SetTranslation(math::Vector3(0, 0, 0.1));
  key = anim->CreateKeyFrame(4.0);
  key->SetTranslation(math::Vector3(0, 0, 0.2));
  key = anim->CreateKeyFrame(6.0);
  key->SetTranslation(math::Vector3(0, 0, 0.3));
  key = anim->CreateKeyFrame(8.0);
  key->SetTranslation(math::Vector3(0, 0, 0.4));
  key = anim->CreateKeyFrame(10.0);
  key->SetTranslation(math::Vector3(0, 0, 0.5));

  _parent->SetAnimation(anim);
2015-10-31 12:31:06 -0500 marked best answer how to use torque to control joint

Hello, may I control the joint using torque like animate_pose as follows, because it just can control the position, I want to add torque to the joint. thank you best guangda

std::map<std::string, common::numericanimationptr=""> anim;

  // Create a new animation for the "my_joint" define in the SDF file.
  // The animation will last for 5.0 seconds, and it will repeat
  anim["box::my_joint"].reset(new common::NumericAnimation(
        "my_animation", 5.0, true));

  // Create a key frame for the starting position of the joint
  common::NumericKeyFrame *key = anim["box::my_joint"]->CreateKeyFrame(0.0);
  key->SetValue(0.0);

  // Create a key frame half-way through the animation
  key = anim["box::my_joint"]->CreateKeyFrame(2.5);
  key->SetValue(-3.14);

  // Create the end key frame to be at the same position as the start
  // for a smooth animation
  key = anim["box::my_joint"]->CreateKeyFrame(5.0);
  key->SetValue(0.0);

 // Attach the animation to the model
  _model->SetJointAnimation(anim);
2015-10-31 12:31:05 -0500 marked best answer fatal error: math/Vector3.hh: No such file or directory

I want to use atlas.cc, so follow the tutorial, but the system of gazebo update from 1.3 to 1.4, and then appear this error: fatal error: common/CommonTypes.hh: No such file or directory, so I modify the #include "common/CommonTypes.hh" to #include "gazebo-1.4/gazebo/common/CommonTypes.hh", and make it, then appear: fatal error: math/Vector3.hh: No such file or directory how to solve it? thanks a lot best guangda

2015-10-31 12:31:04 -0500 marked best answer the question about the contact sensor data

when I get the data of contact sensor, such as, in 1 second, gazebo will generate 16 group(contact size =16)(I know that is the data of different time),and in a group, there are 12 groups data(contact(i).position size=12),whether it means that in that time, the link's 12 groups force and torque must be added up to sum as the result data? and I saw the instance as: // gzerr << " Depth:" << contacts.contact(i).depth(j) << "\n"; fTotal += math::Vector3( contacts.contact(i).wrench(j).body1force().x(), contacts.contact(i).wrench(j).body1force().y(), contacts.contact(i).wrench(j).body1force().z()); tTotal += math::Vector3( contacts.contact(i).wrench(j).body1torque().x(), contacts.contact(i).wrench(j).body1torque().y(), contacts.contact(i).wrench(j).body1torque().z()); } // low pass filter over time double e = 0.99; this->rFootForce = this->rFootForce * e + fTotal * (1.0 - e); this->rFootTorque = this->rFootTorque * e + tTotal * (1.0 - e);

geometry_msgs::Wrench msg;
msg.force.x = this->rFootForce.x;
msg.force.y = this->rFootForce.y;
msg.force.z = this->rFootForce.z;
msg.torque.x = this->rFootTorque.x;
msg.torque.y = this->rFootTorque.y;
msg.torque.z = this->rFootTorque.z;
this->pubRFootContact.publish(msg);

why use double e = 0.99; this->rFootForce = this->rFootForce * e + fTotal * (1.0 - e);? what is the filter's aim? if there is not the 'e', the fTotal cannot be the last result?

and whether are the contact force and torque data equal to the joint force and torque of this link? please help me, thank you.

2015-10-31 12:31:04 -0500 marked best answer how to use the 'gazebo::physics::JointFeedback Class' in the model plugin or sensor plugin?

if I add a model plugin or a sensor plugin, I want to use the gazebo::physics::JointFeedback Class to obtain the force and torque of the link, or use the gazebo::physics::Joint Class to obtain the force and torque and 'SetForce' to a joint? what .h file need to include? and how can I use the class's member function? thank you.

2015-10-31 12:31:03 -0500 marked best answer contact sensor: how to get the force information

Hi, All, I am working on add a contact sensor on a link, and I want to get the torque of the joint of this link, now I meet some question:

  1. msgs::contacts contacts, the order, I cannot find the member function 'contacts' of msgs, where can find the definition of msgs::contacts, and what type Variable is the contacts ? and how can I use its member function or events?

  2. when I use the

    function:unsigned int c = parentSensor->GetCollisionContactCount(const string&test_collision3)
    

    an error will appear:

    ContactPlugin.cc:56:57: error: expected primary-expression before ‘const’
    

    how to solved it? and other function including const appear this error too.

  3. I want to input the data of sensor in a .txt file, how can I do it?

  4. where can the document define the relationship between the sensor plugin.so and the plugin.cc, in CMakelist.txt or in the .world file? because I want to add 3 contact sensors to 3 links, so the plugins must be Distinguished.

thanks a lot

best gdlu

2015-10-31 12:31:00 -0500 marked best answer can the simulator_gazebo of ROS do same job as gazebo under ubuntu?

I am learning simulator_gazebo of ROS, but it is not same with gazebo, when I follow the tutorial of gazebo, I can not continue to do the example, so ,is the simulator_gazebo same to gazebo? and its tutorial is same to gazebo? can it do same job like gazebo?

2015-10-31 12:30:54 -0500 marked best answer why the parameters of collision is difference with the visual in one link?

why the parameters of collision is different from the visual in one link? when visual use mesh from web model, the size of the box is not same with the collision, what influence will appear to the model?

2015-10-31 12:30:30 -0500 marked best answer why does the torque speed control panel of gazebo GUI disappear?

when I updated the drcsim, now the torque speed position control panel of gazebo GUI disappear, how to display it? thank you best gd

2015-10-31 12:30:15 -0500 marked best answer why the contact sensor's time data repeat?

Hi, I use a model plugin to measure the contact force and torque data,I find the time of result repeat to appear, not continue? such as: in the first step, there are 75 groups data, the time from 0 sec 893000000 nsec to 0 sec 991000000 nsec, then, the 2nd group data's time from sec 893000000 nsec to 0 sec 989000000 nsec, like this, the other group data's time are not over 1 sec.I had used class ContactPlugin : public SensorPlugin to measure force data before, the time will continue from 0 second same with the simulation time.but in the new plugin, it appear some question, and my code is same with the previous one. the present code:

for (unsigned int i = 0; i < contacts.contact_size(); ++i)
 //for (unsigned int i = 0; i < 2; ++i)
  {
    math::Vector3 fTotal;
    math::Vector3 tTotal;
    for (unsigned int j = 0; j < contacts.contact(i).position_size(); ++j)
    {
      std::cout << j << "  Position:"
                << contacts.contact(i).position(j).x() << " "
                << contacts.contact(i).position(j).y() << " "
                << contacts.contact(i).position(j).z() << "\n";
      fTotal += math::Vector3(
                            contacts.contact(i).wrench(j).body_1_force().x(),
                            contacts.contact(i).wrench(j).body_1_force().y(),
                            contacts.contact(i).wrench(j).body_1_force().z());
      tTotal += math::Vector3(
                            contacts.contact(i).wrench(j).body_1_torque().x(),
                            contacts.contact(i).wrench(j).body_1_torque().y(),
                            contacts.contact(i).wrench(j).body_1_torque().z());
     }
    double e = 0.99;
    this->llink3_Force = this->llink3_Force * e + fTotal * (1.0 - e);
    this->llink3_Torque = this->llink3_Torque * e + tTotal * (1.0 - e);
    std::cout << " force:"
                       << llink3_Force.x<< " "
                       << llink3_Force.y<< " "
                       << llink3_Force.z<< "\n";
    std::cout << " torque:"
                           << llink3_Torque.x<< " "
                           << llink3_Torque.y<< " "
                           << llink3_Torque.z<< "\n";
    std::cout << " time:"
                          << contacts.contact(i).time().sec()<< " " 
                            <<contacts.contact(i).time().nsec() << "\n";


      }
    }

and I have some doubt about the data, contacts.contactsize() mean the my 75 groups data appear by time? and the contacts.contact(i).positionsize() mean the data appear on different points at same time, so we need add to total? and why use the filter to deal with the data? and the result data as follow:

1 0 893000000 0.0109663 -0.791412 -0.00165563 -0.0366801 -0.000493521 0.00133756  0
2 0 894000000 0.0108009 -1.42664 -0.00182591 -0.0659666 -0.000487837 0.00553323  1
3 0 896000000 0.0107928 -2.62509 -0.00316602 -0.119727 -0.000497939 0.00192567  2
4 0 898000000 0.00970284 -4.42211 -0.00313644 -0.202304 -0.000447923 0.0111408  3
5 0 899000000 0.0103159 -5.02395 -0.00379704 -0.229934 -0.000479064 0.0208921  4
6 0 900000000 0.0112077 -5.93773 -0.00314213 -0.271913 -0.000515583 0.0249442  5
7 0 901000000 0.0152044 -6.52051 -0.00305047 -0.298895 -0.00069924 0.0340604  6
8 0 902000000 0.0341503 -7.04148 -0.00146708 -0.322952 -0.001561 0.04069  7
9 0 904000000 0.0344036 -8.34504 -0.00396462 -0.382565 -0.00159579 0.0507071  8
10 0 906000000 0.0332201 -9.75006 -0.00566672 -0.447299 -0.00156165 0 ...
(more)
2015-10-31 12:30:14 -0500 marked best answer why the contact sensor in atlas robot can not run in my model?

I define the contact sensors like atlas robot:

<gazebo reference="test_link7">
  <sensor name="r_finger3_contact_sensor" type="contact">
      <update_rate>1.0</update_rate>
      <always_on>1</always_on>
      <contact>
        <collision>test_collision7</collision>
        <topic>/test_collision7_contact</topic>
      </contact>
    </sensor>
  </gazebo>
  <gazebo reference="test_link3">
      <sensor name="l_finger3_contact_sensor" type="contact">
      <update_rate>1.0</update_rate>
      <always_on>1</always_on>
      <contact>
        <collision>test_collision3</collision>
        <topic>/test_collision7_contact</topic>
      </contact>
    </sensor>
  </gazebo>

but when I run the model, gazebo show me that the sensors can not be found,so at last,I have to define the sensors at every links. why it can run in atlas and not in my model?

2015-10-31 12:30:11 -0500 marked best answer and how to control the data update_rate?

Hi, when I set the parameter of contact sensor, the updaterate is 1, it mean the sensor should updata it's data in 1 second, but when I run the model and plugin, the data would update faster than the setting in showing terminal,I need the updaterate is 1 second.so the data can be shown in figure. the code:

<sensor name="l_finger3_contact_sensor" type="contact">
      <update_rate>1</update_rate>
      <always_on>1</always_on>
      <visualize>1</visualize>
         <pose>0.10 0 .55 3.1400 0.000000 0.000000</pose>
      <contact>
        <collision>test_collision3</collision>
        <topic>/test_collision3_contact</topic>
      </contact>
    </sensor>

and the plugin:

for (unsigned int i = 0; i < contacts.contact_size(); ++i)
 //for (unsigned int i = 0; i < 2; ++i)
  {
    math::Vector3 fTotal;
    math::Vector3 tTotal;
    for (unsigned int j = 0; j < contacts.contact(i).position_size(); ++j)
    {
      std::cout << j << "  Position:"
                << contacts.contact(i).position(j).x() << " "
                << contacts.contact(i).position(j).y() << " "
                << contacts.contact(i).position(j).z() << "\n";
      fTotal += math::Vector3(
                            contacts.contact(i).wrench(j).body_1_force().x(),
                            contacts.contact(i).wrench(j).body_1_force().y(),
                            contacts.contact(i).wrench(j).body_1_force().z());
      tTotal += math::Vector3(
                            contacts.contact(i).wrench(j).body_1_torque().x(),
                            contacts.contact(i).wrench(j).body_1_torque().y(),
                            contacts.contact(i).wrench(j).body_1_torque().z());
     }
    double e = 0.99;
    this->llink3_Force = this->llink3_Force * e + fTotal * (1.0 - e);
    this->llink3_Torque = this->llink3_Torque * e + tTotal * (1.0 - e);
    std::cout << " force:"
                       << llink3_Force.x<< " "
                       << llink3_Force.y<< " "
                       << llink3_Force.z<< "\n";
    std::cout << " torque:"
                           << llink3_Torque.x<< " "
                           << llink3_Torque.y<< " "
                           << llink3_Torque.z<< "\n";
    std::cout << " time:"
                          << contacts.contact(i).time().sec()<< " " 
                            <<contacts.contact(i).time().nsec() << "\n";


      }
    }

the result data is as follows:

1 0 893000000 0.0109663 -0.791412 -0.00165563 -0.0366801 -0.000493521 0.00133756  0
2 0 894000000 0.0108009 -1.42664 -0.00182591 -0.0659666 -0.000487837 0.00553323  1
3 0 896000000 0.0107928 -2.62509 -0.00316602 -0.119727 -0.000497939 0.00192567  2
4 0 898000000 0.00970284 -4.42211 -0.00313644 -0.202304 -0.000447923 0.0111408  3
5 0 899000000 0.0103159 -5.02395 -0.00379704 -0.229934 -0.000479064 0.0208921  4
6 0 900000000 0.0112077 -5.93773 -0.00314213 -0.271913 -0.000515583 0.0249442  5
7 0 901000000 0.0152044 -6.52051 -0.00305047 -0.298895 -0.00069924 0.0340604  6
8 0 902000000 0.0341503 -7.04148 -0.00146708 -0.322952 -0.001561 0.04069  7
9 0 904000000 0.0344036 -8.34504 -0.00396462 -0.382565 -0.00159579 0.0507071  8
10 0 906000000 0.0332201 -9.75006 -0.00566672 -0.447299 -0.00156165 0.0639809  9
11 0 908000000 0.0465141 -11.1582 -0.00643337 -0.510355 -0.00216282 0.0700995  10
12 0 909000000 0.0465168 -11.8857 -0.00632329 -0.54403 -0.00216257 0.0702505  11
13 0 911000000 0.0466223 -12.9884 -0.0023091 -0.594378 -0.00212853 0.0887632  12
14 0 912000000 0.046328 -13.6845 -0.00519224 -0.626684 -0.00213635 0.0814887  13
15 0 913000000 0.0457015 -14.5768 -0 ...
(more)
2015-10-31 12:30:06 -0500 marked best answer how to modify the color or material of link in gazebo version 1.2?

when I follow the tutorial to modify the color or material like " <material script="Gazebo/Blue"/>" or "color rgb ", gazebo will appear errors, how can I modify the color or materials?

2015-10-31 12:13:08 -0500 marked best answer how to set the rotate axis?

I import two links from solidworks, they are stl files, and I add coodinate system on a hole of the two links,now I want to make the second lind rotate around the setted X axis, but it can not ,how can I deal with it? the code as follow: link: <pose>0 1.0 0.0 0 0 0</pose> <geometry> <box> <url>.......link1.stl</url> </box> </geometry>

<joint name="my_joint" type="revolute"> <parent>world</parent> <child>link</child> <axis> <xyz>1 0 0</xyz> </axis> </joint>

2015-10-31 12:12:55 -0500 marked best answer how to import the 3D model from Solidworks

as title thanks a lot.

2015-10-31 12:12:50 -0500 marked best answer gazebo default directory and can not insert model
  1. where is the gazebo difault directory,I use virtualbox run ros and gazebo, I can only insert the default model from its default directory, and must use "sudo" command to modify the model file.so when I follow tutorial 'build a robot' , I can't insert the model from my created directory, why? Please help me.
  2. In the tutorial 'build a robot', after creating ~/.gazebo/models/manifest.xml file and ~/.gazebo/models/my_robot/model.sdf file, but I can not insert it , because I can not find the file and gazebo only can insert .model file, why? how to solute it?
  3. gazebo_models,but I find the example model in the opt/ros/fuerte/stacks/simulator_gazebo/gazebo/gazebo/share/model, how can I change the default directory to my created directory ~/.gazebo/models/

thanks

2015-10-31 12:12:06 -0500 marked best answer how to solve these errors :[ModelDatabase.cc:290]

when I run gazebo, the errors appear:

1\Error [ModelDatabase.cc:290] Unable to parse manifest.xml for model[http://gazebosim.org/models/doublependulumwithbase] 2\ Error [ModelDatabase.cc:290] Unable to parse manifest.xml for model[http://gazebosim.org/models/kitchendining] 3\ gazebo: /usr/include/boost/smartptr/sharedptr.hpp:418: T* boost::shared_ptr<t>::operator->() const [with T = gazebo::common::NumericAnimation]: Assertion `px != 0' failed.

why appear these? how to solve it?

2015-07-28 18:17:55 -0500 received badge  Notable Question (source)
2015-07-28 18:17:55 -0500 received badge  Famous Question (source)
2015-02-03 21:27:23 -0500 received badge  Famous Question (source)
2015-01-08 15:35:13 -0500 received badge  Famous Question (source)
2014-11-13 10:46:29 -0500 marked best answer how to insert a force or torque sensor to gazebo model?

as title thanks a lot

2014-11-13 10:42:06 -0500 received badge  Good Question (source)
2014-06-13 23:16:51 -0500 received badge  Famous Question (source)
2013-09-19 10:14:10 -0500 received badge  Famous Question (source)
2013-07-24 11:57:42 -0500 received badge  Famous Question (source)
2013-07-23 18:22:25 -0500 received badge  Famous Question (source)
2013-07-13 03:55:24 -0500 received badge  Famous Question (source)
2013-07-08 02:50:35 -0500 received badge  Famous Question (source)
2013-07-08 02:18:23 -0500 received badge  Famous Question (source)
2013-06-27 08:07:00 -0500 received badge  Popular Question (source)
2013-05-21 14:54:45 -0500 received badge  Notable Question (source)
2013-04-25 15:04:10 -0500 received badge  Notable Question (source)
2013-04-23 01:58:32 -0500 received badge  Notable Question (source)
2013-04-19 05:58:28 -0500 received badge  Famous Question (source)
2013-04-16 17:33:44 -0500 received badge  Notable Question (source)
2013-04-13 22:56:55 -0500 received badge  Notable Question (source)
2013-04-12 00:11:02 -0500 received badge  Popular Question (source)