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

Functions

 value_by_label (label)
 

Variables

str COM_PORT = "COM13"
 
int TRAILING_POINTS = 16
 
int MIN_MESSAGE_BYTES = 16
 
float FORCE_SCALING = 0.02
 
 ser
 
list x_list = []
 
list z_list = []
 
list x_mirror_list = []
 
list z_mirror_list = []
 
 pp
 
 alpha
 
 bytes_to_read = ser.in_waiting
 
 line = ser.read(bytes_to_read).decode("utf-8")
 
 segments = line.split()
 
 x = value_by_label("pos.at(0)")
 
 z = value_by_label("pos.at(2)")
 
 x_mirror = value_by_label("mirror_pos_0")
 
 z_mirror = value_by_label("mirror_pos_2")
 
int F_stiffness_x = 0
 
int F_stiffness_z = 0
 
int F_damping_x = 0
 
int F_damping_z = 0
 
int F_kx = 0
 
int F_kz = 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()

finger_viz.value_by_label ( label)

Definition at line 57 of file finger_viz.py.

Variable Documentation

◆ alpha

finger_viz.alpha

Definition at line 39 of file finger_viz.py.

◆ bytes_to_read

finger_viz.bytes_to_read = ser.in_waiting

Definition at line 48 of file finger_viz.py.

◆ COM_PORT

str finger_viz.COM_PORT = "COM13"

Definition at line 9 of file finger_viz.py.

◆ F_damping_x

finger_viz.F_damping_x = 0

Definition at line 66 of file finger_viz.py.

◆ F_damping_z

finger_viz.F_damping_z = 0

Definition at line 67 of file finger_viz.py.

◆ F_kx

finger_viz.F_kx = 0

Definition at line 68 of file finger_viz.py.

◆ F_kz

finger_viz.F_kz = 0

Definition at line 69 of file finger_viz.py.

◆ F_stiffness_x

finger_viz.F_stiffness_x = 0

Definition at line 64 of file finger_viz.py.

◆ F_stiffness_z

finger_viz.F_stiffness_z = 0

Definition at line 65 of file finger_viz.py.

◆ FORCE_SCALING

float finger_viz.FORCE_SCALING = 0.02

Definition at line 12 of file finger_viz.py.

◆ line

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

Definition at line 51 of file finger_viz.py.

◆ MIN_MESSAGE_BYTES

int finger_viz.MIN_MESSAGE_BYTES = 16

Definition at line 11 of file finger_viz.py.

◆ pp

finger_viz.pp
Initial value:
1= PointsInSpace(
2 "End Effector Position",
3 "Z [m]",
4 "X [m]",
5 xlim=[-0.15, 0.15],
6 ylim=[0, 0.15],
7 enable_grid=True,
8 enable_legend=True,
9)

Definition at line 30 of file finger_viz.py.

◆ segments

finger_viz.segments = line.split()

Definition at line 52 of file finger_viz.py.

◆ ser

finger_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 14 of file finger_viz.py.

◆ TRAILING_POINTS

int finger_viz.TRAILING_POINTS = 16

Definition at line 10 of file finger_viz.py.

◆ x

finger_viz.x = value_by_label("pos.at(0)")

Definition at line 60 of file finger_viz.py.

◆ x_list

list finger_viz.x_list = []

Definition at line 25 of file finger_viz.py.

◆ x_mirror

finger_viz.x_mirror = value_by_label("mirror_pos_0")

Definition at line 62 of file finger_viz.py.

◆ x_mirror_list

list finger_viz.x_mirror_list = []

Definition at line 27 of file finger_viz.py.

◆ z

finger_viz.z = value_by_label("pos.at(2)")

Definition at line 61 of file finger_viz.py.

◆ z_list

list finger_viz.z_list = []

Definition at line 26 of file finger_viz.py.

◆ z_mirror

finger_viz.z_mirror = value_by_label("mirror_pos_2")

Definition at line 63 of file finger_viz.py.

◆ z_mirror_list

list finger_viz.z_mirror_list = []

Definition at line 28 of file finger_viz.py.