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

joined robots simulation [closed]

asked 2012-12-14 07:18:52 -0500

updated 2012-12-23 04:37:16 -0500

Hi all!

I need to simulate two joined robots with gazebo simulator (ROS-fuerte). I am able to spawn both robots separately with their xacro files and staff in the same world, but I don't know how to indicate that the base_link of the second robot is attached to an other link of the first one. Basically I've to attach an arm to a mobile robot and I have to tell to the arm xacro that its parent link is the base_link of the mobile robot. In the robot2 xacro I use $(parent) specified as a parameter and parent has the value of robot1_name::base_link but it does not find that link.

Is there any example on how to join different robots toghether? Anyone has tried it?

Thank you very much!

Àngel.


EDIT:

I will try to be more specific: Actually the problem is not spawn the joined robots, the problem is spawn them working with both controllers. The first robot (quadrotor) uses an own controller, the second uses a pr2 controller. Basically when I try to spawn both robots joined, the spawner of the pr2_controller_manager makes no work the first controller. If I do not load the last node: pr2_controller_manager with iri_ros_controller (controller of the arm), the quadrotor controller works but the arm controller not. I cannot load the own build controller of the quadrotor with the pr2_controller_manager (as args of the node) because it has no specific type.

(Running the launch file as I attached, the quadrotor controller does not work because the pr2_controller_manager is launched without quadrotor args).

Here I attach the launch file (all in one):

<launch>

<!--************** Gazebo WORLD *******************-->
  <include file="$(find hector_gazebo_worlds)/launch/rolling_landscape_120m.launch"/>

<!-- ************* Robot with no controllers ******-->
  <arg name="model_quadrotor" default="$(find kinton_sim)/Media/urdf/quadrotor_hokuyo_utm30lx.urdf.xacro"/>
<!-- send the robot XML to param server -->
  <param name="robot_description" command="$(find xacro)/xacro.py '$(arg model_quadrotor)'" />
<!-- push robot_description to factory and spawn robot in gazebo -->
  <node name="spawn_quadrotor_robot" pkg="gazebo" type="spawn_model" args="-param robot_description -urdf -z 1.5 -model kinton" respawn="false" output="screen"/>
<!-- start robot state publisher -->
  <node pkg="robot_state_publisher" type="state_publisher" name="kinton_state_publisher" output="screen" >
            <param name="publish_frequency" type="double" value="50.0" />
  </node>  
  <node name="ground_truth_to_tf" pkg="message_to_tf" type="message_to_tf" output="screen">
    <param name="odometry_topic" value="ground_truth/state" />
    <param name="frame_id" value="nav" />
  </node>   
<!-- Buffer Server -->
  <node pkg="tf2_ros" type="buffer_server" name="tf2_buffer_server" output="screen">
    <param name="buffer_size" value="120.0"/>
  </node>

<!-- *********** Default Controllers *************>

  <!-- Arm Control -->
   <rosparam command="load" file="$(find kinton_sim)/controllers/iri_ros_controller.yaml" />

<!-- Start Default Controllers ********** PROBLEM HERE ********** -->
  <node name="default_controllers_spawner" pkg="pr2_controller_manager" type="spawner" output="screen" args="iri_ros_controller" />

</launch>

If I use this last launch file, I cannot control the quadrotor and it appears at 0,0,0 of the world without moving when I launch the pr2_controller_manager spawner with the arm controller.

I have looked at the other answers similar to this one but their solutions do not work for me.

edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant. Please see http://wiki.ros.org/Support for more details. by Àngel - IRI
close date 2013-03-13 05:20:45

Comments

When you say "joined robots" do you mean something like a mobile robot base with a manipulator fixed on it?

georgebrindeiro gravatar image georgebrindeiro  ( 2012-12-14 09:54:45 -0500 )edit

Yes, it is.

Àngel - IRI gravatar image Àngel - IRI  ( 2012-12-16 19:17:55 -0500 )edit

Oh, sorry I did not attach info with the error. The problem is not to join the robots, the problem is to use pr2Controllermanager with the robot joined. I have edited the answer with new info.

Àngel - IRI gravatar image Àngel - IRI  ( 2012-12-16 22:13:43 -0500 )edit

Thank you dbworth but I was using what you told me...So this is not a valid answer for me...

Àngel - IRI gravatar image Àngel - IRI  ( 2012-12-16 22:25:28 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2012-12-14 17:51:18 -0500

dbworth gravatar image

updated 2012-12-14 17:57:44 -0500

Hi Àngel,

Yes I think you can see "joining" of robots in various stacks, e.g. you might find something like the mobile WAM robot. Also it's practically the same principle as describing the manipulator once, but using Xacro to include it twice to create a dual-arm robot, e.g. DARPA ARM or Schunk dual-arm robot.

Firstly make copies of the xacro files of the base and the manipulator.
You might need to edit one to make sure the 2nd file (manipulator) doesn't have a 'base_link' in it.

Make a new xacro:

<?xml version="1.0"?>
<robot name="joinedrobot">

<!-- include xacro file containing a link where you want to attach the manipulator -->
<include filename="$(find mobilerobot_description)/urdf/robot.urdf.xacro"/>

<joint name='jointhem_fixed_joint' type='fixed'>
<!-- you can specify xyz offset to locate the manipulator -->
<origin xyz="0 0 0" rpy="0 0 0" />
<parent link='location_for_arm_link' />
<child link='manipulator_base_link'>

<!-- include xacro file where there first link is called manipulator_base_link -->
<include filename="$(find manipulator_description)/urdf/manipulator_no_baselink.urdf.xacro"/>

</robot>

When you load the xacro file, it will merge all the code together.

Here's a good launch file example, that will load the URDF model in Rviz and allow you to test the joint movements using a GUI:

<?xml version="1.0"?>
<launch>
    <param name="robot_description" command="$(find xacro)/xacro.py '$(find joinedrobot_description)/urdf/joinedrobot.urdf.xacro'" />

    <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />

    <param name="use_gui" value="true" />
    <node pkg="joint_state_publisher" type="joint_state_publisher" name="joint_state_publisher"/>

    <node name="rviz" pkg="rviz" type="rviz" args="-d $(find joinedrobot_description)/rviz/joinedrobot.vcg" />
</launch>

Once you're happy with this "new" robot, spawn it as a single robot.

edit flag offensive delete link more

Comments

Thank you, but this does not answer my problem. I have edited the initial question to be more precise. The problem is using different kinds of controllers (one for the quadrotor and an other for the arm), because I cannot use the first controller with pr2_controller_manager.

Àngel - IRI gravatar image Àngel - IRI  ( 2012-12-17 03:22:07 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2012-12-14 07:18:52 -0500

Seen: 878 times

Last updated: Dec 23 '12