This sections provides a quick guide to start the AIP application. It enables you to run the complete AIP system and engineer your extended application.
For more information, please also review the corresponding AIP MS Teams Team: IRAS Students/General/01-IRAS_Wiki/2-Projects/2.1-Automated_Item_Picking
- Plug in the cabinet and power all devices
- Check the PLC status
- Check the KUKA SmartPad status
- Start your docker environment on the laboratory PC
Notes:
-
The ejectors switch while the PLC is starting up. If there is compressed air in the system at the same time, this leads to a loss of pressure and a noticeable noise. However, this is not dramatic. As soon as the PLC has started up, the ejectors are set to their normal state and the pressure loss ends.
To prevent this behaviour, the air supply on the Festo maintenance unit can be closed.
-
If the PLC is not starting properly, the 7 days trial license may be outdated. To verify, please open the electrical cabinet and check if the PLC is in run mode (green light) or in configuration mode (blue light). If the blue light is on, this can be an license issue. For a quick solution, please check the assigned trouble shooting of this repository.
-
To use the system after it has been switched on, the blue button on the control panel must be pressed. This does not light up at the beginning. Then the safety release has then been given and the robot can be used.
There are 4 different options to operate the AIP application which will be described in the following subchapters.
-
Switch to user group Administrator on smartHMI (pw: kuka)
-
Make sure to clean all errors, shown in green rectangle in the picture below
-
If the error "NOT-Halt nur lokal" occurs and red LED on the PLC CPU is blinking, probably the PLC is not in RUN mode.
-
Make sure that the drives are switched on
-
Make sure to set KUKA KR 10 into T1 mode
-
Push the enabling switch of the SmartPad while moving an axis with the buttons, marked with the red rectangle in the picture below, or the 6D mouse.
To operate the gripper manually with the SmartPad, please checkHow to use KUKA SmartPad.
The robot has been set into EKI mode in order to listen to the Linux-PC.
Import: If you´re not familiar with ROS2 and AIP commands, please check out the Cheatsheet with terminal commands for quick help.
-
Switch to user group Administrator on SmartPad
-
Activate project "ros2_driver" on SmartPad, if not already active
- Open project management window (Blue WorkVisual icon, gear with robot inside)
- Select "ros2_driver" in Verfügbare Projekte → Entpinnen
- "Aktivieren" → Ja
- Wait until project is activated
-
On SmartPad navigate to R1 → Program → ros2_driver
-
Load the file "kuka_eki_hw"
-
Click on "Abwählen" to deactivate the current programm
-
Click on "Anwählen" to activate the "kuka_eki_hw"
-
Execute the programm
-
During the execution you can see the following code:
Further information for this operating mode can be found in the corresponding repository: IRAS-HKA/aip_bringup. Especially, the ReadMe provides a brief overview for the start up.
-
Prerequisite: Docker and connection to robot is up and running
-
Clone and build repository "AIP Bringup"
-
Open a terminal (Ctrl + Alt + T) and navigate to project folders
mkdir -p ~/projects && cd ~/projects
-
Clone repository, if not already cloned. Log in with your RZ account.
git clone https://github.com/IRAS-HKA/aip_bringup.git
-
Navigate to cloned repository
cd aip_bringup
-
Build container
./start_docker.sh
If everything went well, you should be in the container like this:
robot@IRAS-IRL0-LIN:~/ros_ws$
-
Set ROS_DOMAIN_ID. If there are multiple robots in use, make sure, that the set ROS_DOMAIN_ID is different on each PC
export ROS_DOMAIN_ID=<id>
-
You can check your currently set ROS_DOMAIN_ID by running
echo $ROS_DOMAIN_ID
-
In the container, build workspace:
colcon build
-
Source workspace
source install/setup.bash
-
-
Start launch file
-
Execute the still running container
docker exec -it aip_bringup bash
-
As you have opened a new terminal, you need to set your ROS_DOMAIN_ID again, use the same ID as before
export ROS_DOMAIN_ID=<id>
-
You can check your currently set ROS_DOMAIN_ID by running
echo $ROS_DOMAIN_ID
-
Source workspace
source install/setup.bash
-
Launch robot driver with MoveIt2 wrapper
ros2 launch aip_bringup aip.launch.py use_fake_hardware:=true robot_ip:=10.166.32.145
This will open up a simulated hardware with visualisation.
To launch the real robot:
- Make sure that you are in the local network (Wi-Fi AND LAN)
- Test your application in simulation first (see above)
- Make sure that the robot is not in a collision state when the application is executed on the real robot
- If everything is fine, please execute:
ros2 launch aip_bringup aip.launch.py use_fake_hardware:=false robot_ip:=10.166.32.145
Pay attention: If you´ve set the parameter use_fake_hardware:=false, the action will be executed on the real robot. Make sure that it won´t trigger a collision.
-
Use mouse courser to drag robot to your desired position
-
Click "Plan" in order to plan the trajectory in the simulation
-
Click "Plan & Excecute" in order to move the robot and in the simulation
-
-
Check out tutorial code
- Please check out the repository IRAS-HKA/aip_bringup, if you haven´t already.
The information for how to move the robot using a behavior tree are described in the repository IRAS-HKA/aip_coordinator and the How to use AIP Coordinator of this repository.
The "IRAS Coordinator" package provides a starting point for high-level task control of the AIP robot application.
The library of actions can be freely arranged using the "Groot" graphical user interface. There are instructions on how to create and start the Docker container as well as instructions on how to start debugging.
Once the container is started, the description can be used to design a new or change the behavior tree in Groot.
Furthermore, instructions are given on how to create a new custom node and how to create behavior trees.
To control the gripper, we have created two services: /open_gripper and /close_gripper.
Both are using the iras_interfaces/srv/MoveGripper-datatype.
The only input is cylinder_ids, which an array of int32. The content of the array are the ejectors, which will be opened. Those are being read from the behavior tree.
-
Prerequisite: Docker (AIP_BringUP) and connection to robot is up and running.
-
It is recommended to use Terminator to use many terminal windows in parallel.
-
Connect with second terminal to existing docker session:
docker exec -it aip_bringup bash
Connect in first terminal with the robot:
ros2 launch aip_bringup aip.launch.py use_fake_hardware:=false robot_ip:=10.166.32.145
**Note:** If `use_fake_hardware:=true` then the gripper controller node will not be started. This can be done when running AIP only virtually in Rviz.
-
In the third terminal you can execute the following python scripts in order to move the robot based on coordinates. This needs to be executed in the AIP_Coordinator.
(IF AIP_Coordinator docker is not already running) cd ../aip_coordinator source start_docker.sh (IF AIP_Coordinator docker is running) docker exec -it aip_coordinator ros2 launch aip_bringup aip.launch.py
This will execute the behavior tree using groot.
-
To edit the tree switch to the edit mode and save the tree afterwards.
-
This will take effect on the next start:
ros2 launch aip_bringup aip.launch.py
-
Open gripper (AIP_Coordinator/ AIP_BringUP)
* works in both dockers * ros2 service call /open_gripper iras_interfaces/srv/MoveGripper "cylinder_ids: {cylinder_ids: [1,2,3,4]}"
-
Close gripper (AIP_Coordinator/ AIP_BringUP)
- works in both dockers *
ros2 service call /close_gripper iras_interfaces/srv/MoveGripper "cylinder_ids: {cylinder_ids: [1,2,3,4]}"
-
Cancel robot operation Use Strg+ C to cancel the terminal which is running the command:
ros2 launch aip_bringup aip.launch.py use_fake_hardware:=false robot_ip:=10.166.32.145
-
Disconnect the gripper but not the robot: Use Strg+ C to cancel the terminal which is running the command:
ros2 launch aip_bosch_gripper aip_bosch_gripper_node.launch only_visualize:=false