Gazebo | Ignition | Community
Ask Your Question

gabri89's profile - activity

2019-09-05 10:51:38 -0500 marked best answer Problem with start controller with roslaunch: controller spawner couldn't find the expected controller_manager ROS interface

Hy everyone, I'm using ros jade with gazebo 5.2. I tried to follow this tutorial. After launching the rrbot_world.launch, I try to do :

 roslaunch rrbot_control rrbot_control.launch

I've this response

    SUMMARY
========

PARAMETERS
 * /rosdistro: jade
 * /rosversion: 1.11.16
 * /rrbot/joint1_position_controller/joint: joint1
 * /rrbot/joint1_position_controller/pid/d: 10.0
 * /rrbot/joint1_position_controller/pid/i: 0.01
 * /rrbot/joint1_position_controller/pid/p: 100.0
 * /rrbot/joint1_position_controller/type: effort_controller...
 * /rrbot/joint2_position_controller/joint: joint2
 * /rrbot/joint2_position_controller/pid/d: 10.0
 * /rrbot/joint2_position_controller/pid/i: 0.01
 * /rrbot/joint2_position_controller/pid/p: 100.0
 * /rrbot/joint2_position_controller/type: effort_controller...
 * /rrbot/joint_state_controller/publish_rate: 50
 * /rrbot/joint_state_controller/type: joint_state_contr...

NODES
  /
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
  /rrbot/
    controller_spawner (controller_manager/spawner)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[rrbot/controller_spawner-1]: started with pid [5768]
process[robot_state_publisher-2]: started with pid [5769]
[INFO] [WallTime: 1455881521.257272] [0.000000] Controller Spawner: Waiting for service controller_manager/load_controller
[WARN] [WallTime: 1455881551.416911] [109.233000] Controller Spawner couldn't find the expected controller_manager ROS interface.
[rrbot/controller_spawner-1] process has finished cleanly
log file: /home/gabriele/.ros/log/33f60b1a-d6fc-11e5-8b0c-e839df8a64f0/rrbot-controller_spawner-1*.log

The WARN says that the spawner couldn't not found the controller manager. I already have this command line :

sudo apt-get install ros-jade-ros-control ros-jade-ros-controllers

What's wrong? Could it be a compatibility problem between my gazebo/ros distro?

Then I don't understand what is control_manager. Should it be a directory? Because in my rrbot_control I can't see it. Have I to create it?

Thank you, bye!

2017-04-11 12:25:18 -0500 received badge  Self-Learner (source)
2017-04-11 12:25:18 -0500 received badge  Teacher (source)
2016-08-28 09:18:20 -0500 received badge  Famous Question (source)
2016-07-25 07:54:55 -0500 received badge  Taxonomist
2016-06-13 06:36:47 -0500 received badge  Famous Question (source)
2016-06-10 03:13:48 -0500 received badge  Notable Question (source)
2016-06-08 06:23:05 -0500 received badge  Popular Question (source)
2016-06-05 05:52:15 -0500 asked a question Symbolic jacobian of an arm

Hi all,

I've a 7 DOF arm described in .xacro format and I would like to extrapolate its jacobian in symbolic form (not numerical angle values in the matrix ).

I tried to use KDL for this scope, and I was able to obtain the jacobian of this arm but in a numerical form. That is, during a gazebo simulation, I could read the values of each angles, insert them in the jacobian matrix with a specific kdl command, and obtain the jacobian matrix on every gazebo step time.

That's ok, but if I have another target in which I need the symbolic for of this jacobian from which extrapolate other matrix (inertial, coriolis ecc..), I'm not able to do this. (For example if I want to control my arm in a particular way in which I need the dynamic expression of the system).

Has anyone every have this problem? Is there a method with kdl or another software that I can use?

Thank you!

2016-06-02 04:28:07 -0500 commented answer Has anyone ever used KDL and kdl_parser?

I try to explain better. I've an arm in gazebo, in the .xacro format. I want to extrapolate the jacobian and some other matrix of this arm using KDL, but I'm not still able to do this. I'm not sure to have installed KDL correctly. If I've KDL, have I to do a c++ file in my catkin_ws? Is there a template to follow? Thank you

2016-05-18 10:34:52 -0500 commented answer Has anyone ever used KDL and kdl_parser?

Hi TwoBid, thank you for your answer. Yes I referred to the ROS side. I tried to follow your link for modify dependencies in CmakeList and package of my_robot. Then I tried to make a C++ code link in the example in the kdl_parser tutorial and I've this error : undefined reference to "KDL::Tree::Tree(std::string const&)" ; another error : undefined reference to "kdl_parser::treeFromFile(...)" . Where am I wrong? Thank you!

2016-05-18 09:21:09 -0500 received badge  Famous Question (source)
2016-05-18 05:00:09 -0500 received badge  Notable Question (source)
2016-05-18 05:00:09 -0500 received badge  Popular Question (source)
2016-05-18 04:12:30 -0500 asked a question Has anyone ever used KDL and kdl_parser?

Hi all,

I'm trying to extrapolate the jacobian and the matrix for the dynamic form of my arm. The arm is in .xacro file, so I tried to follow this tutorial for kdl_parser and this for KDL. But I've some difficulties, I'm not able to understand how to usr kdl_parser. The arm is in a catkin_ws directory, so can I use an external C++ code or I have to use kdl and kdl_parser function in my plugin? What have I to modify in CMakeList and package.xml? (are this two file owned to catkin_ws or to my_arm directory?)

Is there someone who has already use kdl that can help me?

Thank you!

2016-05-12 05:14:01 -0500 answered a question My robot arm moves as soon as it's loaded in Gazebo

It was a stupid error: I set upper and lower limit to one joint, but it started out from this range. So Gazebo tried to bring the joint in the closer limit.

2016-05-11 03:08:01 -0500 received badge  Famous Question (source)
2016-05-06 16:12:31 -0500 received badge  Notable Question (source)
2016-05-06 05:04:57 -0500 received badge  Popular Question (source)
2016-05-06 04:18:42 -0500 received badge  Famous Question (source)
2016-05-06 02:02:52 -0500 commented question My robot arm moves as soon as it's loaded in Gazebo

It seems that there is a force on some link/joint. I tried to add <selfcollide>false</selfcollide> but nothing changes. I can't understand what's the cause of the motion.

2016-05-05 04:29:04 -0500 asked a question My robot arm moves as soon as it's loaded in Gazebo

Hi everyone,

I've loaded a robot arm in Gazebo. It's rappresented in urdf file and it appear correctly. I launch gazebo paused, but when I start the simulation the arm moves alone, without any applied force. It can be due by some contact (internal) force in the arm? Have you any suggests?

It seem that the arm goes to a new position, than it stays there.

Thank you!

Hi @nkoenig , and hi everyone.

I update my questions. I have an urdf directory, with the .xacro file. In this .xacro file I created link and joints eith this template:

<!-- ARM -->
<link name ="name_link">
<inertial>
  <origin xyz="-0.00543349 -0.04480023 0.01581062" rpy="0 0 0"/>
  <mass value="1.81745527"/>
  <inertia ixx="0.00571053"  ixy="0.00041083"  ixz="-0.00005130" iyy="0.01126908" iyz="-0.00003461" izz="0.01371197" />
</inertial>
<visual>
  <origin xyz="0 0 0" rpy="0 0 0"/>
  <geometry name="name_link_visual">
    <mesh filename="package://my_directory/meshes/mesh_name.STL" scale="0.001 0.001 0.001" />
  </geometry>
  <material name="material_name"/>
</visual>
<collision>
  <origin xyz="0 0 0" rpy="0 0 0"/>
  <geometry name="name_link_collision">
    <mesh filename="package://my_directory/meshes/simple/mesh_name.STL" scale="0.001 0.001 0.001" />
  </geometry>             
</collision>

</link>

And joints:

<joint name="joint_name" type="revolute">
<parent link="link_name1"/>
<child link="link_name2"/>
<origin xyz="0.036 0.0 -0.15" rpy="0 0 0" />
<axis xyz="0 1 0" />
<limit velocity="6.283" effort="60" lower="${-170.0*toRad}" upper="${34.0*toRad}" />
<dynamics friction="100" damping="10.0"/>       
</joint>

I used same meshes that are in meshes directory, and are .stl type. I tried to change joints friction and damping ( I increase them), and the behaviour change, but the motion of the arm remains. Do you think that this values can be the problem? I connect the arm with a fixed link, even if I connect them without contact, the arm begins to rotate. Can I modify something? Thank you.

2016-05-03 04:50:45 -0500 received badge  Notable Question (source)
2016-05-02 10:52:34 -0500 commented answer Problem with plugin referencing to a joint.

Thank you, I solved the problem with your help! So I have a std::vector<std::string> containing all the joints name.

2016-05-02 04:12:03 -0500 received badge  Famous Question (source)
2016-04-30 10:33:36 -0500 answered a question Problem with plugin referencing to a joint.

Hi, screpeters.

Ok, but I'm not able to obtain more than a joint name from xacro file. I made this in my xacro file :

<gazebo>
    <plugin name="motor_spring" filename="/home/gabriele/gazebo_plugin_tutorial/build/libmotor_spring_plugin.so"> 
    <alwaysOn>true</alwaysOn>
    <NumJoint> 2 <NumJoint>
    <JointName>joint1 , joint2</JointName>
</plugin>

</gazebo>

But I can't obtain a vector of string in my plugin. How I can get a list of joints name? I used std::vector<std::string>, but it's not true. Thank you!

2016-04-29 07:36:58 -0500 received badge  Notable Question (source)
2016-04-27 09:54:54 -0500 received badge  Popular Question (source)
2016-04-26 11:23:22 -0500 asked a question Problem with plugin referencing to a joint.

Hi,

I made a gazebo plugin which simulates a particular motor. To do this I created this plugin which inherits from a ModelPlugin, and I take the joint from a model class. If there is a single joint it's ok, but if there are two or more joints, I need to give a reference to the plugin. As this link suggests I used the reference name of the joint in the gazebo tag.

<joint name="joint1" type="revolute">
<parent link="link1"/>
<child link="link2"/>
<origin xyz="0 ${width} ${height1 - axel_offset}" rpy="0 ${PI} 0"/> 
<limit lower="${-1.5*PI}" upper="${1.5*PI}" velocity="${2*PI}" effort="220"/> 
<axis xyz="0 1 0"/>
<dynamics damping="0.7"/>
<spring_stiffness>2300</spring_stiffness>
</joint>

<gazebo reference="joint1">
<plugin name="motor_spring" filename="/home/gabriele/gazebo_plugin_tutorial/build/libmotor_spring_plugin.so">
    <alwaysOn>true</alwaysOn>
</plugin>
</gazebo>

The compilation is ok, but when I try to start gazebo I see this warning:

Warning [parser.cc:713] XML Element[plugin], child of element[joint] not defined in SDF. Ignoring[plugin]. You may have an incorrect SDF file, or an sdformat version that doesn't support this element.

Do I wrong in positioning the gazebo tag in my xacro file? Do I wrong to use a ModelPlugin type? If there are more joint that uses the plugin, there is another way to do it?

Thank you!

2016-03-30 16:03:20 -0500 received badge  Famous Question (source)
2016-03-27 11:29:41 -0500 received badge  Famous Question (source)
2016-03-26 01:54:05 -0500 received badge  Popular Question (source)
2016-03-23 04:29:19 -0500 asked a question How to obtain the gravity force from a link or a joint in a gazebo plugin?

Hi,

I'm writing a plugin to implement a particular behaviour of a motor, then it will be included in a RR robot to make same test.

I implemented the dynamic, with a external input ad a noise. I set the gravity on in the .xacro file. The problem is that I can't see the influence of the gravity in my model: I think that somehow, I have to extrapolate the gravity force from the model and introduce it in the dynamic equation.

I tried to use the command

force=joint->GetLinkForce(1);

This command should return the force applied in the centre of mass of the link. But I don't understand in which frame this force is referred to : doesn't seem the joint reference frame.

Can you tell me something more?

The command

    torque=joint->GetLinkTorque(1);

should return torque applied in the centre of mass. What does it mean? Does it intend that the point from which we calculate the moment is the centre of mass? If it is true, the result of the command is not due to the gravity force.

Then I tried to use other command of the link class of gazebo. For example I used

torque=link->GetWorldTorque();

or

force=link->GetWorldForce();

These commands returns the force/torque applied to the link expressed in the world frame. The problem is that probably in the return are included constrain force, so I'm not able to isolate the gravity force (or the generated moment).

There is same method to solve my problem?

Are there other command that can help me to extrapolate the gravity force in the world frame, or in another frame with a known rotation?

Thank you, bye.

2016-03-23 03:48:39 -0500 answered a question Use of GetLinkForce or GetLinkTorque

Hi I solved the proble adding

joint1->SetProvideFeedback(1);

command. So I can use GetLinkForce without problem.

2016-03-17 07:18:15 -0500 received badge  Notable Question (source)
2016-03-16 13:32:44 -0500 received badge  Popular Question (source)
2016-03-16 13:27:28 -0500 commented answer Use of GetLinkForce or GetLinkTorque

Hi, I would like to obtain the force applied on the link at every gazebo step. So, as usual I get the pointer to the joint in the Load function: joint=this->model->GetJoint("joint_name"); Then in the OnUpdate function (called in the Load) I try to obtain the force: force=joint->GetLinkForce(index); (I defined force as a class variable math::Vector3). This causes segmentation fault. Can my problem be caused by an error on the pointer? I thought that it was caused by the GetLinkForce function.

2016-03-16 12:14:32 -0500 asked a question Use of GetLinkForce or GetLinkTorque

Hi,

In my gazebo plugin, I have to use the function

virtual math::Vector3 gazebo::physics::Joint::GetLinkForce ( unsigned int   _index) const pure virtual

or

virtual math::Vector3 gazebo::physics::Joint::GetLinkTorque ( unsigned int  _index) const pure virtual

These functions should return the force applied at the centre of mass of a link; the problem is that this functions are pure virtual, so I must define them. I could use the ODEJoint class (that inherits from Joint class): this owns the above functions, but only virtual.

I don't understand how to use the ODEJoint class, nay how to include this class in my plugin.

Can I use this functions without having ODEJoint?

Thank you!

2016-03-16 07:38:38 -0500 received badge  Famous Question (source)
2016-03-07 09:49:36 -0500 commented answer How to understand if my plugin is loaded in gazebo?

Yes, I made the nodehandle as a class member and I created a "publisher". So I can see the topic with rostopic list. Thank you!

2016-03-07 05:11:27 -0500 received badge  Notable Question (source)
2016-03-03 07:50:00 -0500 received badge  Notable Question (source)
2016-03-02 02:39:36 -0500 received badge  Popular Question (source)
2016-03-01 05:52:53 -0500 asked a question How to understand if my plugin is loaded in gazebo?

Hi again,

I created a ModelPlugin to simulate a motor with spring in a R robot. When I compile the plugin, it works and a file .so is generated. The I add the plugin in my URDF file in this way :

  <gazebo>
    <plugin name="motor_spring_plugin" filename="libmotor_spring_plugin.so">
    </plugin>
 </gazebo>

When I run gazebo with roslaunch there is no error and the robot appears. However I'm not able to understand if my plugin is effectively loaded in my model. How can I test it?

Moreover in this plugin I created a ros_node subscriber in the Load() function:

 public: void Load(physics::ModelPtr _parent, sdf::ElementPtr /*_sdf*/)
{

    if (!ros::isInitialized()) //check if ros is initialized properly
        {
          ROS_FATAL("ROS has not been initialized!");
          return;
        }


  ros::NodeHandle n;
  ros::Subscriber sub=n.subscribe("chatter", 1000, &MotorSpring::Callback, this);
      ...something... 
 this->UpdateConnection=event::Events::ConnectWorldUpdateBegin(boost::bind(&MotorSpring::OnUpdate,this,_1));

}

(the Callback function is defined as public function) Is it true?

When gazebo is running, if I start rostopic list from terminal, the topic chatter doesn't appear.

Why? It is caused by the whole plugin or I made some mistakes in the ros piece of code?

Thank you