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