5.1.1.1. node_ur5_1_pick¶
ROS Node for UR5_1 arm to pick packages from shelf and place them on conveyor belt.
At first, the colour of the packages are detected by importing the qr node. Then the inventory sheet is updated by sending a goal to the action server. After that whenever a new order is placed on the MQTT topic “/eyrc/vb/isPicuTP/orders”, it is appended to a local list. This list is sorted according to the priority of the orders and then the order at the top of list is processed and picked up from the shelf and placed on conveyor belt. The details of the dispatched order are than updated in the “DispatchedOrder” sheet by sending a goal to the action server.
-
class
node_ur5_1_pick.
DispatchedPkg
[source]¶ Class to store name and colour of the dispatched package
-
class
node_ur5_1_pick.
RosIotBridgeActionClient
[source]¶ Action Client to act as a bridge between ROS Nodes and IOT to update google spreadsheets
-
on_transition
(goal_handle)[source]¶ This function will be called when there is change of state in the Action Client State Machine
Parameters: goal_handle – unique id of goal Returns: None
-
-
class
node_ur5_1_pick.
ShelfCamera
[source]¶ Store information regarding colour of packages on shelf as recognised by the 2D Camera
-
get_pkg_colour
(row, column)[source]¶ Return colour of package present on specific row and column
Parameters: Returns: list of colour of all the packages present on shelf
Return type:
-
get_pkg_colour_list
()[source]¶ Return list of colour of all the packages present on the shelf
Returns: List of colour of all the packages present on the shelf Return type: list
-
-
class
node_ur5_1_pick.
Ur5Moveit
(arg_robot_name)[source]¶ Initialize necessary objects to operate a UR5 arm
Initialize trajectory publisher, execute client, planning scene interface, move group commander, vacuum gripper service and other necessary things for proper interface of Ur5 arm with Gazebo, MoveIt! and RViz
Parameters: arg_robot_name (str) – Name of Ur5 arm to control Example: ur5_1 = Ur5Moveit(‘ur5_1’)
-
hard_play_saved_trajectory
(trajectory, arg_max_attempts)[source]¶ Try playing a trajectory again and again until success or max attempts exhausted
Parameters: - trajectory (JointTrajectory) – Trajectory to be played
- arg_max_attempts (int) – Max number of attempts to try again in case of failure
Returns: success flag
Return type:
-
hard_set_joint_angles
(arg_list_joint_angles, arg_max_attempts)[source]¶ Try to set the joint angles again and again until success or max attempts exhausted
Parameters: Returns: None
-
-
node_ur5_1_pick.
find_correct_pkg_on_shelf
(camera, current_order, at_waiting_pose)[source]¶ Function to find the correct package to be picked up from the shelf
Parameters: Returns: row and column of the required package
Return type:
-
node_ur5_1_pick.
go_to_home_position
(ur5_1)[source]¶ Move UR5#1 arm to its home position
Parameters: ur5_1 (Object of class Ur5Moveit) – Object of class Ur5Moveit to control UR5#1 arm Returns: None
-
node_ur5_1_pick.
go_to_package
(ur5_1, saved_trajectories, row, column)[source]¶ Move the UR5#1 arm to the package to pick it up
Parameters:
-
node_ur5_1_pick.
load_saved_trajectories
(saved_trajectories)[source]¶ Load all the saved trajectories and store them in a dictionary
Parameters: saved_trajectories (dict) – Dictionary to store the loaded trajectories Returns: None
-
node_ur5_1_pick.
main
()[source]¶ Main node to control UR5_1 arm.
This function is called to start the pick and place operation of UR5_1 arm. :return: None
-
node_ur5_1_pick.
new_order_callback
(msg, orders_list)[source]¶ Callback function called whenever a new order is placed
Parameters: - msg (json object) – Order details
- orders_list (list) – List of the current active orders
Returns: None
-
node_ur5_1_pick.
start_conveyor_belt
(power)[source]¶ Function to start the conveyor belt at a certain power
Parameters: power (int) – power of the belt to be set Returns: success flag Return type: bool
-
node_ur5_1_pick.
stop_conveyor_belt
()[source]¶ Function to stop the conveyor belt
Returns: Success flag Return type: bool
-
node_ur5_1_pick.
update_inventory
(pkg_colour_list, action_client)[source]¶ Update inventory spreadsheet
Parameters: - pkg_colour_list (list) – List of colour of all the packages present on the shelf
- action_client (Object of class RosIotBridgeActionClient) – action client to send goals to push data on spreadsheet
Returns: None
-
node_ur5_1_pick.
update_orders_dispatched_sheet
(order, action_client)[source]¶ Update dispatched orders spreadsheet
Parameters: - order (dict) – Information of the order dispatched
- action_client (Object of class RosIotBridgeActionClient) – action client to send goal to push data on spreadsheet
Returns: None
-
node_ur5_1_pick.
waiting_position_benefit
(camera)[source]¶ This function is called to check if there will be any benefit in picking up package quickly from the shelf if we go to waiting position or not. It checks whether there are 3 types of packages(red, yellow, and green) are available in the shelf area covered by the waiting position or not.
Parameters: camera (Object of class ShelfCamera which stores all info related to packages on shelf) – object storing information packages present on the shelf Returns: Benefit or not to go and wait at home position Return type: bool