Index>Robot Kit>RaspArm-S Kit for RPi>Lesson 24 Using json Data to Record and Repeat Actions

Lesson 24 Using json Data to Record and Repeat Actions

1145

In this lesson, we will learn how to use json data to record and repeat actions.

24.1 Editting a new motion path

In the adeept_rasparms/server directory of the Raspberry Pi, there is a plan.json file, edit this file, you can edit and save the motion path information of the robotic arm, save it after editing, and the saved motion path information can be automatically run next time you run the robotic arm program. Here is how to modify it.

1. Open the terminal software MobaXterm:

image.png 


2. Log in to your Raspberry Pi (the way to log in to the Raspberry Pi has been introduced in Lesson 1), in the file manager of the MobaXterm terminal, find the adeept_rasparms/server directory, right-click the file plan.json, open the plan.json file by selecting the third-party tool Sublime Text by "Open with" in the options:

image.png 


【Note】:

If you don't have the third-party tool Sublime Text, you can use the nano command of Linux to operate, and the specific method can be viewed in 2.4.


3. After opening, as shown below, the data of these two-dimensional arrays is to save and record the coordinate data of the robot arm at a certain position. Each element in the array represents the coordinate information of a position, such as [90,140,0,90] ,it means the coordinate information of a position point. The first data is the X-axis coordinate position, the second data is the Y-axis coordinate position, the third data is the Z-axis coordinate position, and the fourth data is the rotation of the chuck. angle.

The three elements in the array are three different locations:[[90, 140, 0, 90],[-90, 140, 0, 0],[0, 140, 90, 0]], which are connected when the robot arm enters the automatic operation mode (in GUI or Web application interface, click the buttonimage.png, the robot arm enters the automatic motion mode), the path of its motion is saved in the plan.json file location point. If you want to run the new path automatically, you can manually modify the data at the corresponding location in the plan.json file and save it.

image.png 

【Note】:

When you click Save, you need to select "Yes".

image.png