Welcome to JetCobot repository
2.Read data
Read data
API Overview
APIs related to reading robotic arm data are as follows
get_angles()
Function: Read the angles of the six joints of the robotic arm.
Parameter explanation:
- Return value: Returns six joint angle values.
get_coords()
Function: Read the current position coordinate value of the robotic arm.
Parameter explanation:
- Return value: Returns the current position coordinate value of the robotic arm
get_encoders()
Function: Read the potential values of the six joints of the robotic arm
Parameter explanation:
- Return value: Return the potential values of the six joints of the robotic arm.
get_radians()
Function: Read the arc values of the six joints of the robotic arm.
Parameter explanation:
- Return value: Returns the radian values of the six joints of the robotic arm.
get_gripper_value()
Function: Read the angle value of the robotic arm gripper.
Parameter explanation:
- Return value: Returns the angle value of the robotic arm gripper.
2. About code
Code path:~/jetcobot_ws/src/jetcobot_ctrl/scripts/read_data.ipynb
#!/usr/bin/env python3#coding=utf-8import osimport timefrom pymycobot.mycobot import MyCobotInitialize the robotic arm object.
xxxxxxxxxxmc = MyCobot(str(os.getenv('MY_SERIAL')), 1000000)Read and print the angles of the six joints of the robotic arm.
xxxxxxxxxxangles = mc.get_angles()print("read angles:", angles)Read and print the coordinates of the robotic arm.
xxxxxxxxxxcoords = mc.get_coords()print("read coords:", coords)Read and print the potential value of the robotic arm.
xxxxxxxxxxencoders = mc.get_encoders()print("encoders:", encoders)
Read and print the arc value of the robotic arm.
xxxxxxxxxxradians = mc.get_radians()print("read radians:", radians)
Read and print the gripper angle of the robotic arm.
xxxxxxxxxxgripper = mc.get_gripper_value()print("gripper:", gripper)
3.Run program
Click the run button on jupyterlab to run the relevant programs.
