KUKA IIWA 7 R800 python simulator
This folder contains necessary files to run the simulation of the KUKA IIWA 7 R800 robot
Contents
Installation
Install Docker (see Docker how-to)
clone this repository
cd SOME_PATH git clone git@gitlab.fel.cvut.cz:body-schema/robots/kuka.git kuka_ws cd kuka_ws && git checkout pyKUKA
run the docker (see Docker how-to for more parameters)
cd SOME_PATH/kuka_ws/Docker
to build it on your computer (slower variant, can tak hours):
./deploy.py -b -p SOME_PATH/kuka_ws -c kuka_sim
you should be in docker environment. Run
cd kuka_ws catkin config --init --extend /opt/ros/noetic catkin build source devel/setup.bash
the setup is now completed.
catkin configmay not work if you initialized the workspace before. Runcatkin clean --yesand repeat fromcatkin configTo test if everything works:
roscore & rviz
you should see RVIZ window running. Close it and run
pkill -f roscoreto stop the roscore
Run the Docker again after installation
go to the Docker folder and run deploy command again
cd SOME_PATH/kuka_ws/Docker ./deploy.py -e -c kuka_sim
the same can be achieved with
docker start kuka_sim && docker attach kuka_sim
to open new terminal in docker
use deploy.py
./deploy.py -t -c kuka_simor
docker exec -it kuka /bin/bash
Code
The documentation PDF can be found in kuka.pdf.
Online documentation is available at lukasrustler.cz/pykuka.
Run
- The simulator can be run in two mode:
ROS version - real-time, high-level planners (MoveIt!, …)
Native - much faster than real-time, only low-level control
ROS version
install necessary things and build the workspace
see Installation
run the simulator
in the terminal, run
roslaunch bullet_ros simulation.launch
this will start the simulator and RVIZ with the robot #### Control the robot
to test the connection etc. you can just move the robot in RVIZ and plan from there
or, see examples.py
it shows how to control the robot, gripper. How to play trajectories and how to get IK without moving
the simulated robot provides
position_controllers/JointTrajectoryControllerandvelocity_controllers/JointGroupVelocityController, i.e., waypoint controller through moveit or direct assignment of joint velocities to the jointsthe default is
PositionJointInterface_trajectory_controller. You need to switch with rosservice/controller_manager/switch_controllerbefore running joint commandssee examples.py for an example
Non-ROS version
install necessary things
see Installation
you can run examples from examples folder
scripts cartesian_example.py and joints_example.py show how to control the robot in cartesian and joint space, respectively.
Docker how-to
FAQ
applications do not run on your screen (or you have some strange screen related errors)
in another terminal run
xhost local:dockerif it does not work, try
xhost +if this does not work, nothing can be done
you get error of not being in sudo group when running image
check output of
id -ucommand. If the output is not 1000 you have to build the image by yourself and can not pull itthis happens when your account is not the first one created on your computer
``sudo apt install something`` does not work
you need to run
sudo apt updatefirst after you run the container for the first timeapt things are removed in Dockerfile, so it does not take unnecessary space in the image
Docker Installation
install docker-engine (DO NOT INSTALL DOCKER DESKTOP), do post-installation steps and (optional) install nvidia-docker
Parameters for deploy.py
cdto folder with Dockerfile./deploy.py-bor--buildwhen buildingdefault: False
-nvor--nvidiawhen you want to use your Nvidia cardyou have to use it when creating a new container
default: False
-eif you just want to run existing docker without buildingdefault: False
-por--pathwith path to current folderdefault: “”
cor--containerwith desired name of the new, created containerdefault: my_new_docker
tor--terminalto run new terminal in running docker sessiondefault: False
-puor--pullto pull the image from our NAS serverdefault: False
-pvor--python-versionto specify addition python version to installdefault: 3.11
-pcvor--pycharm-versionto specify version of pycharm to usedefault: 2023.2.3
Do this on computer where you will run the code. If you have a server you have to run it on the server over SSH to make things work properly.
Non-docker installation
This repository contains files to make everything run under ros noetic on Ubuntu 20.04. If you want to install it by yourself, see Dockerfile for inspiration. Also, use pcan_python as it is changed from python2 to python 3; and peak-linux-driver as this is working version. There are probably some hacks needed, so see the Dockerfile.
pyKUKA
- pyKUKA
- pykuka module
EndEffectorJointLinkpyKUKApyKUKA.compute_skin()pyKUKA.contactPointspyKUKA.create_urdf()pyKUKA.dynamicsInfopyKUKA.find_joint_id()pyKUKA.find_link_id()pyKUKA.get_joint_state()pyKUKA.get_link_id()pyKUKA.init_robot()pyKUKA.is_alive()pyKUKA.jointInfopyKUKA.jointStatespyKUKA.kill_open3d()pyKUKA.linkInfopyKUKA.motion_done()pyKUKA.move_cartesian()pyKUKA.move_position()pyKUKA.move_velocity()pyKUKA.prepare_log()pyKUKA.print_collision_info()pyKUKA.run_vhacd()pyKUKA.stop_robot()pyKUKA.toggle_gravity()pyKUKA.update_simulation()pyKUKA.visualShapeDatapyKUKA.wait_motion_done()
- utils module
- visualizer module
- gripper module
- pykuka module
- Examples
bullet_ros
- bullet_ros
- main module
- motion_interface module
MoveGroupPythonInterfaceMoveGroupPythonInterface.all_close()MoveGroupPythonInterface.apply_planning_scene()MoveGroupPythonInterface.close_gripper()MoveGroupPythonInterface.display_trajectory()MoveGroupPythonInterface.execute_plan()MoveGroupPythonInterface.get_current_state()MoveGroupPythonInterface.get_ee_pose()MoveGroupPythonInterface.go_to_joint_position()MoveGroupPythonInterface.go_to_pose()MoveGroupPythonInterface.open_gripper()MoveGroupPythonInterface.plan_cartesian_path()MoveGroupPythonInterface.stop_robot()
- robot_kinematics_interface module
- Examples