Hello, I need help here in controlling two Universal Robots in the same Simulation Window.
I have made my own launch file which can launch two ur5’s at the same time in the same simulation. The launch file is,
roslaunch two_ur5 start.launch
<launch>
<arg name="robot_name"/>
<arg name="init_pose"/>
<arg name="paused" default="false" doc="Starts gazebo in paused mode" />
<arg name="gui" default="true" doc="Starts gazebo gui" />
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" default="worlds/empty.world"/>
<arg name="paused" value="$(arg paused)"/>
<arg name="gui" value="$(arg gui)"/>
</include>
<group ns="robot1">
<param name="tf_prefix" value="robot1_tf" />
<include file="$(find ur_gazebo)/launch/ur5.launch">
<arg name="init_pose" value="-x 1 -y 1 -z 0.2"/>
<arg name="robot_name" value="robot1"/>
</include>
</group>
<group ns="robot2">
<param name="tf_prefix" value="robot2_tf" />
<include file="$(find ur_gazebo)/launch/ur5.launch">
<arg name="init_pose" value="-x 1 -y -1 -z 0.2"/>
<arg name="robot_name" value="robot2"/>
</include>
</group>
</launch>
But when it comes two controlling using it “moveit” I can only control one of them at one time, my controllers.yaml
file is
controller_list:
- name: robot1/arm_controller
action_ns: follow_joint_trajectory
type: FollowJointTrajectory
default: true
joints:
- shoulder_pan_joint
- shoulder_lift_joint
- elbow_joint
- wrist_1_joint
- wrist_2_joint
- wrist_3_joint
controller_list:
- name: robot2/arm_controller
action_ns: follow_joint_trajectory
type: FollowJointTrajectory
default: true
joints:
- shoulder_pan_joint
- shoulder_lift_joint
- elbow_joint
- wrist_1_joint
- wrist_2_joint
- wrist_3_joint
The above .yaml
controls only one of the two robots
The launch file for controlling the obot using moveit
is,
roslaunch demo_moveit_config demo_planning_execution.launch
<launch>
<rosparam command="load" file="$(find demo_moveit_config)/config/joint_names.yaml" />
<include file="$(find demo_moveit_config)/launch/planning_context.launch">
<arg name="load_robot_description" value="true"/>
</include>
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
<param name="/use_gui" value="false"/>
<rosparam param="/source_list">[/joint_states]</rosparam>
</node>
<include file="$(find demo_moveit_config)/launch/move_group.launch">
<arg name="publish_monitored_planning_scene" value="true"/>
</include>
<include file="$(find demo_moveit_config)/launch/moveit_rviz.launch">
<arg name="config" value="true"/>
</include>
</launch>
This is the result I get which is displayed in the following picture,
Also, the motion planning is presented in the above image.
I have the following questions,
- How can I pass a single command from RviZ so that my both the robots follow the same command and execute the trajectory at the same time?
- How can I pass two different commands to robot1 and robot2 for e.g. (Goal state as “Home” for the first robot (robot-1) and Goal State as “Up” for the second robot (robot-2)) at the same time so that they execute their corresponding trajectories (as per the command given to them) at the same time in the same simulation window.
I would be glad if anyone can answer me the questions with suitable examples for better understanding as I need to know this for my Thesis.