Haptic Controller
Loading...
Searching...
No Matches
thumb_viz Namespace Reference

Functions

 value_by_label (label)
 

Variables

str COM_PORT = "COM11"
 
int TRAILING_POINTS = 16
 
int MIN_MESSAGE_BYTES = 16
 
 ser
 
list joint_0_list = []
 
list joint_1_list = []
 
list joint_0_mirror_list = []
 
list joint_1_mirror_list = []
 
 pp
 
 alpha
 
 bytes_to_read = ser.in_waiting
 
 line = ser.read(bytes_to_read).decode("utf-8")
 
 segments = line.split()
 
 joint_0 = value_by_label("joint_thetas.at(0)")
 
 joint_1 = value_by_label("joint_thetas.at(1)")
 
 joint_0_mirror = value_by_label("mirror_pos_0")
 
 joint_1_mirror = value_by_label("mirror_pos_2")
 
int joint_0_torque = 0
 
int joint_1_torque = 0
 

Detailed Description

Reads data from a serial port and displays it in real-time using matplotlib.
Make sure to set COM_PORT to the correct value before running.

Function Documentation

◆ value_by_label()

thumb_viz.value_by_label ( label)

Definition at line 53 of file thumb_viz.py.

Variable Documentation

◆ alpha

thumb_viz.alpha

Definition at line 37 of file thumb_viz.py.

◆ bytes_to_read

thumb_viz.bytes_to_read = ser.in_waiting

Definition at line 44 of file thumb_viz.py.

◆ COM_PORT

str thumb_viz.COM_PORT = "COM11"

Definition at line 9 of file thumb_viz.py.

◆ joint_0

thumb_viz.joint_0 = value_by_label("joint_thetas.at(0)")

Definition at line 56 of file thumb_viz.py.

◆ joint_0_list

list thumb_viz.joint_0_list = []

Definition at line 24 of file thumb_viz.py.

◆ joint_0_mirror

thumb_viz.joint_0_mirror = value_by_label("mirror_pos_0")

Definition at line 58 of file thumb_viz.py.

◆ joint_0_mirror_list

list thumb_viz.joint_0_mirror_list = []

Definition at line 26 of file thumb_viz.py.

◆ joint_0_torque

thumb_viz.joint_0_torque = 0

Definition at line 61 of file thumb_viz.py.

◆ joint_1

thumb_viz.joint_1 = value_by_label("joint_thetas.at(1)")

Definition at line 57 of file thumb_viz.py.

◆ joint_1_list

list thumb_viz.joint_1_list = []

Definition at line 25 of file thumb_viz.py.

◆ joint_1_mirror

thumb_viz.joint_1_mirror = value_by_label("mirror_pos_2")

Definition at line 59 of file thumb_viz.py.

◆ joint_1_mirror_list

list thumb_viz.joint_1_mirror_list = []

Definition at line 27 of file thumb_viz.py.

◆ joint_1_torque

thumb_viz.joint_1_torque = 0

Definition at line 62 of file thumb_viz.py.

◆ line

thumb_viz.line = ser.read(bytes_to_read).decode("utf-8")

Definition at line 47 of file thumb_viz.py.

◆ MIN_MESSAGE_BYTES

int thumb_viz.MIN_MESSAGE_BYTES = 16

Definition at line 11 of file thumb_viz.py.

◆ pp

thumb_viz.pp
Initial value:
1= PointsInSpace(
2 "Tip",
3 "Joint 0 [Radians]",
4 "Joint 1 [Radians]",
5 xlim=[-2, 2],
6 enable_grid=True,
7 enable_legend=True,
8)

Definition at line 29 of file thumb_viz.py.

◆ segments

thumb_viz.segments = line.split()

Definition at line 48 of file thumb_viz.py.

◆ ser

thumb_viz.ser
Initial value:
1= serial.Serial(
2 port=COM_PORT,
3 baudrate=115200,
4 parity=serial.PARITY_NONE,
5 stopbits=serial.STOPBITS_ONE,
6 bytesize=serial.EIGHTBITS,
7 timeout=0,
8)

Definition at line 13 of file thumb_viz.py.

◆ TRAILING_POINTS

int thumb_viz.TRAILING_POINTS = 16

Definition at line 10 of file thumb_viz.py.