Utilization of computing resources
Schematic diagram of Transition and Scaleout pattern
, Pattern for utilizing computing resource
of ROS application on Kubernetes by RDBOX
Learning in this chapter
- How to execute the applications using external computing resources such as cloud computing because those applications are difficult to run at SBC (Raspberry Pi) on TurtleBot3 that has few computer resources (CPU, memory, disk, GPU, etc.)
- In this tutorial, continue to use the application of tutorial 1 "Deploy robot application with Kubernetes" to control multiple robots. Also deploy the remote application (turtlebot3_remote.launch etc.).
- Up to the
7.3 Load a TurtleBot3 on Rviz
of7.Bringup
of TurtleBot3 manual ROBOTIS e-Manual and8.Basic Operation - 8.2.Teleop-8.2.1.keybord
are the scope of this deployment. Please be sure to check in advance. - In this tutorial, "Transition and Scaleout pattern" is introduced instead of "Remote PC" in the manual of TurtleBot3 manual
ROBOTIS e-Manual
.
- How to use "other rich computing resource", using the Kubernetes function such as "Deploy", "Rolling update", "Rollback", "Scale out / Scale in", practiced in Tutorial 1 "Deploying robot applications with Kubernetes".
- How to apply the following functions of Kubernetes
- Persistent volume
- Container Lifecycle Hooks
- Easy to use ROS debugging tools (such as rviz and rostopic commands)
- Run rviz etc. from a GUI based PC on which ROS (kinetic Desktop full) is installed on the RDBOX network.
Application overview
In this chapter, you will use the Kubernetes deployment called Remote Application
to practice the usage pattern of Transition and Scaleout pattern
in ROS applications in Kubernetes. This section explains the remote application as the ROS application, and also the remote application as the Kubernetes deployment.
Remote application as ROS application
- As a remote application, you mainly run
robot state publisher
corresponding toroslaunch turtlebot3_bringup turtlebot3_remote.launch
andloading URDF file
.- In addition, as same as the tutorial 1 "Deploy robot applications with Kubernetes", as the control application, you will mainly execute the keyboard teleoperation by
roslaunch turtlebot3_teleop turtlebot3_teleop_key.Launch
. As a launch application, you mainly perform the launch process equivalent toroslaunch turtlebot3_bringup turtlebot3_robot.launch
. - As a difference from Tutorial 1 "Deploy robot applications with Kubernetes", rqt_graph allows you to check the topic of joint_states on each namespace.
- In addition, as same as the tutorial 1 "Deploy robot applications with Kubernetes", as the control application, you will mainly execute the keyboard teleoperation by
- Just as in Tutorial 1 "Deploy robot applications with Kubernetes", you adopt
multi master
which has one roscore for one TurtleBot3. - And one remote application in TurtleBot3 (=roscore) in the multi master above. This remote application is set up using Kubernetes so that it runs on a different computer from TurtleBot3 (=roscore).
- For each remote application, specify the corresponding roscore with the environment variable
ROS_MASTER_URI
. In addition, in the case of TurtleBot3, specifyTURTLEBOT3_MODEL
according to the model.
- For each remote application, specify the corresponding roscore with the environment variable
- Using the topic of joint_states, you can check and debug various information of the robot with rviz.
Remote application as Kubernetes application
We will explain the remote application as an example of "Schematic diagram of Transition and Scaleout pattern" at the beginning.
- The remote application is Kubernetes Deployment related to turtlebot3_remote.launch.
- The remote application is defined in the remote application's template file (yaml) called
rdbox/tutorials/tutorial-2/tb3-remote.yaml.tmpl
.- As the file name indicates, this yaml file is the template that can be replaced the part of it.
- In this tutorial, the character string to be replaced is a character string enclosed by . They are "" and "".
- (1) Pod
tb3-bringup-xxxxx
running on TurtleBot3 uses Kubernetes persistent volume (PV) to refer to the remote application template filerdbox/tutorials/tutorial-2/tb3-remote.yaml.tmpl
.- Various storage can be used for external storage used as Persistent Volume. In this tutorial,
rdbox-master-00
is used as an NFS server. - Place the key file ("/etc/kubernetes/admin.conf" at rdbox-k8s-master (192.168.179.2)) on the persistent volume and use the
kubectl
command in the container on TurtleBot3 for the remote application template file to be deployed.
- Various storage can be used for external storage used as Persistent Volume. In this tutorial,
- According to the information of each TurtleBot3, change the remote application template file
rdbox/tutorials/tutorial-2/tb3-remote.yaml.tmpl
running on TurtleBot3 which can be referred to fromtb3-bringup-xxxxx
. And deploy it withkubectl apply
command.- (2) Execute
execute_kubectl-apply_on_each_master_for_tb3.bash
using KubernetesContainer Lifecycle Hooks
as a trigger. - (3) [Transition] By specifying
ROS_MASTER_URI
, you can run the ROS node of a specific TurtleBot3 on any computer. In this tutorial you will replaceROS_MASTER_URI
with sed command and shell script.- You can also use various template engines such as JinJa 2. ( Is the replacement pattern string used in JinJa2.)
- (4) [Expansion] Apply the matching template among the multiple template files placed in the permanent volume according to the information (node label) of each TurtleBot3.
- Using the Kubernetes node label, since the applied yaml file is different, you can assign arbitrary processing to each TurtleBot3.
- (2) Execute
Prerequisites for this tutorial
- Tutorial 1 "Deploying Robot Applications with Kubernetes" has been done and you understand its processing.
- Prepare one 'working PC' connected to the wireless LAN access point of RDBOX. Please connect to wireless LAN according to each OS. Also, the working PC must be a GUI-based machine with ROS (kinetic Desktop full) installed. Also, you need to be able to use SSH on working PC.
- SSID:g-rdbox-1234,a-rdbox-1234
- Passphrase (common g-rdbox-1234,a-rdbox-1234) :gL7bQKFz
Please download the necessary files in advance.
- Please clone the yaml file describing the deployment to Kubernetes.
git clone https://github.com/rdbox-intec/rdbox.git
- The PC on which this operation is executed is as follows.
- A PC accessible to the Kubernetes dashboard
- PC with modern browser (Chrome or Firefox)
- A PC on which kubectl can run
- rdbox-k8s-master (192.168.179.2) etc.
- A PC accessible to the Kubernetes dashboard
- The yaml files used in this tutorial are as follows.
$ cd rdbox/tutorials/tutorial-2 $ ls docker_files
Up [ ToC ]
Next [ Setup persistent volumes ]
from Hacker News https://ift.tt/31t4mVD
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.