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

Spawn and control second arm using OpenManipulator and MoveIt

asked 2019-06-14 10:33:15 -0600

ashaker gravatar image

Hello,

I am currently working on a project where I spawn and control 2 arms independently in the same scene for a robot. I am going off of the OpenManipulator documentation/tutorials and using MoveIt to control their default arm, from this link:

http://emanual.robotis.com/docs/en/pl...

and

http://emanual.robotis.com/docs/en/pl...

So the idea is that, in a few different terminals, I am running the following commands to spawn a gazebo and rviz instance that are tied together, and I am able to use the provided GUI to manipulate a single arm or use code.

$ roslaunch open_manipulator_gazebo open_manipulator_gazebo.launch (spawns gazebo and robot arm with basic topics/nodes)

$ roslaunch open_manipulator_controller open_manipulator_controller.launch use_platform:=false (spawns rvis, with the same arm, and creates moveit controllers for the arm. I also modified this launch file to turn moveit to true)

$ roslaunch open_manipulator_control_gui open_manipulator_control_gui.launch (spawns provided gui)

I want to manipulate the launch files somehow to spawn a second arm that I can manipulate independently the same way I can control the first arm. I am finding no luck so far, and I am still working on the gazebo one. Not sure how I will go about the controller one that spawns rviz.

I manipulated the gazebo launch file as follows and was able to get 2 arms to show up, but not getting the topics or services to group separately or have their own unique names, or even spawn.

open_manipulator_gazebo.launch

https://pastebin.com/U26tq515

open_manipulator_controller.launch (the one in the open_manipulator_gazebo package, not open_manipulator_controller package. this one is called by the above launch file)

https://pastebin.com/2QPVeAAG

This is where the original source code is from so you can compare it to the original launch files: https://github.com/ROBOTIS-GIT/open_m...

Any help would be appreciated. Since this is my first time posting, and I am quite new to ROS, forgive me if I overlooked something simple or made a mistake in the post formatting. If I left out any important information let me know and I'll be happy to provide it.

Thank you for your time

Sincerely,

Alfred Shaker

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-06-17 14:25:40 -0600

ashaker gravatar image

I actually found a solution for this after messing around some more with the launch files and doing research on how they work and such. I was able to get a simulation running with 2 independent arms with all the topics and services and nodes correctly duplicated and under the right namespace for each arm. I also had to create a second version of the URDF files just for convenience sake so as to work with this package easier. I gave them a _2 suffix.

Here is the resulting code for the initial launch file, in the open_manipulator_gazebo package:

<launch>
  <!-- These are the arguments you can pass this launch file, for example paused:=true -->
  <arg name="use_robot_name" default="open_manipulator"
       doc="Must match the robotNamespace tag in the gazebo description file"/>

  <arg name="use_robot_name_2" default="open_manipulator_2"
       doc="Must match the robotNamespace tag in the gazebo description file"/>

  <arg name="paused" default="true"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>

  <!-- We resume the logic in empty_world.launch, changing only the name of the world to be launched -->
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(find open_manipulator_gazebo)/worlds/empty.world"/>
    <arg name="debug" value="$(arg debug)" />
    <arg name="gui" value="$(arg gui)" />
    <arg name="paused" value="$(arg paused)"/>
    <arg name="use_sim_time" value="$(arg use_sim_time)"/>
    <arg name="headless" value="$(arg headless)"/>
  </include>


  <!-- Load the URDF into the ROS Parameter Server -->
  <param name="robot_description"
   command="$(find xacro)/xacro --inorder '$(find open_manipulator_description)/urdf/open_manipulator.urdf.xacro'"/>


  <!-- Run a python script to the send a service call to gazebo_ros to spawn a URDF robot -->
  <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen"
     args="-urdf -model open_manipulator -z 0.0 -param robot_description"/>

  <!-- ros_control robotis manipulator launch file -->
  <include file="$(find open_manipulator_gazebo)/launch/open_manipulator_controller.launch">
    <arg name="use_robot_name" value="$(arg use_robot_name)"/>
  </include>

    <!-- Load the URDF into the ROS Parameter Server -->
  <param name="robot_description_2"
   command="$(find xacro)/xacro --inorder '$(find open_manipulator_description)/urdf/open_manipulator_2.urdf.xacro'"/>


  <!-- Run a python script to the send a service call to gazebo_ros to spawn a URDF robot -->
  <node name="urdf_spawner_2" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen"
     args="-urdf -model open_manipulator_2 -y 1.0 -param robot_description_2"/>

  <!-- ros_control robotis manipulator launch file -->
  <include file="$(find open_manipulator_gazebo)/launch/open_manipulator_controller.launch">
    <arg name="use_robot_name" value="$(arg use_robot_name_2)"/>
  </include>

</launch>

I changed the open_manipulator_controller.launch file back to the original version, so it is unchanged from what is in the open_manipulator_gazebo package:

<launch>
  <arg name="use_robot_name"         default="open_manipulator"/>

  <!-- Load joint controller configurations from YAML file to parameter server -->
  <rosparam file="$(find open_manipulator_gazebo)/config/open_manipulator_controller.yaml" command="load"
            ns="$(arg use_robot_name)"/>

  <!-- load the controllers -->
  <node name="controller_spawner" pkg="controller_manager" type="spawner ...
(more)
edit flag offensive delete link more

Comments

AndyZe gravatar image AndyZe  ( 2022-09-29 10:51:43 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-06-14 10:33:15 -0600

Seen: 854 times

Last updated: Jun 17 '19