5.1.3.1. task5_solution.launch


5.1.3.1.1. Description

Launch file to launch all the ROS nodes and services. This file is used to run the simulation by entering the following command in terminal

$ roslaunch pkg_task5 task5_solution.launch

This is how the file looks like:

 <launch>

<!-- ################################ NOTE FOR INSTRUCTORS ############################################## -->
<!-- We have observed that a package is missed by the UR5_2 arm when we run the simulation -->
<!-- with Nvidia graphics card whereas it do not when simulation is run with integrated Intel graphics card. -->
<!-- This is a common issue of vacuum gripper not working properly faced by other teams as well. -->
<!-- So we request to run our simulation with the integrated graphics card and still if a package is missed, -->
<!-- please don't reduce our marks because in the video it is clearly seen that all the packages -->
<!-- have been picked up successfully. -->
<!-- #################################################################################################### -->

<!-- Add Models PATH for Gazebo -->
<env name="GAZEBO_MODEL_PATH" value="$(find pkg_vb_sim)/models"/>

<!-- Arguments -->
<arg name="paused" default="false"/>
<arg name="use_sim_time" default="true"/>
<arg name="gui" default="true"/>
<arg name="rviz" default = "false"/>
<arg name="headless" default="false"/>
<arg name="debug" default="false"/>
<arg name="extra_gazebo_args" default="--verbose"/>

<!-- Spawn Task-5 Models in Gazebo -->
<include file="$(find pkg_vb_sim)/launch/task5_world.launch" />

<!-- Spawn two UR5 in Gazebo -->
<include file = "$(find pkg_vb_sim)/launch/two_ur5_gazebo.launch" />

<!-- Spawn Task 5 Boxes -->
<rosparam file ="$(find pkg_vb_sim)/config/config_package_colour.yaml"/>
<node name= "task5_spawn_models" pkg= "pkg_vb_sim" type="task5_spawn_models.py"/>

<!-- Run Conveyor Belt Service Server -->
<node name= "node_service_server_conveyor_belt" pkg= "pkg_vb_sim" type="node_service_server_conveyor_belt.py" output="screen"/>

<!-- Run the Online Order Placer Node -->
<rosparam file ="$(find pkg_vb_sim)/config/config_online_order.yaml"/>
<node name= "node_online_order_placer" pkg= "pkg_vb_sim" type="node_online_order_placer.py" output="screen"/>

<!-- Launch two move_group nodes for the two UR5 Arms -->
<include file="$(find pkg_vb_sim)/launch/two_ur5_move_group.launch" />

<rosparam file ="$(find pkg_ros_iot_bridge)/config/config_pyiot.yaml"/>

<node name="node_action_server_ros_iot_bridge" type="node_action_server_ros_iot_bridge.py" pkg="pkg_ros_iot_bridge" output="screen"/>

<!-- This node is responsible for picking up the packages from shelf and putting them on -->
<!-- conveyor belt. Before starting, this nodes call another node called qr_decode to -->
<!-- identify the colour of all the packages using Qr decode method. After dropping the package on -->
<!-- conveyor belt, it also publishes the name and colour of the package on a ros topic to -->
<!-- communicate the information to the UR5_2 arm -->
<node name="node_ur5_1_pick" type="node_ur5_1_pick.py" pkg="pkg_task5" output="screen"/>

<node name="incoming_order_handler" type="incoming_order_handler.py" pkg="pkg_task5" output="screen"/>

<!-- This node is responsible for dropping the packages in their respective bins -->
<!-- It decides the bin on the basis of information provided by the UR5_1 arm on the ros topic. -->
<node name="node_ur5_2_place" type="node_ur5_2_place.py" pkg="pkg_task5" output="screen"/>

<!-- Recording Bag File for Submission -->
<arg name="record" default="false"/>
<arg name="rec_name" default="t5.bag"/>

<group if="$(arg record)">
    <node name="rosbag_record_pick" pkg="rosbag" type="record"
   args="record -O $(find pkg_task5)/bag_files/$(arg rec_name) --chunksize=10 /eyrc/vb/ur5_1/vacuum_gripper/logical_camera/ur5_1 /eyrc/vb/ur5_2/vacuum_gripper/logical_camera/ur5_2" output="screen"/>
</group>

</launch>

5.1.3.1.2. Job

  1. Add Models PATH for Gazebo
  2. Spawn Task-5 Models in Gazebo
  3. Spawn two UR5 in Gazebo
  4. Spawn packages on shelf
  5. Run Conveyor Belt Service Server
  6. Run the Online Order Placer Node
  7. Launch two move_group nodes for the two UR5 Arms
  8. Record bag file
  9. Launch UR5_1 node
  10. Launch UR5_2 node
  11. Launch Incoming order handler node