forked from tormach/hal_ros_control
-
Notifications
You must be signed in to change notification settings - Fork 6
/
hal_hw_interface.hal
36 lines (30 loc) · 1.04 KB
/
hal_hw_interface.hal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# 100Hz thread
newthread robot_hw_thread 10000000 fp
# Load the hal_hw_interface component
loadrt $(COMP_DIR)/hal_hw_interface
addf hal_hw_interface robot_hw_thread
# Connect position command to feedback via limit3 comp to simulate
# joints obeying physics
loadrt limit3 names=joint1-pos,joint2-pos
# joint 1
net joint1-pos-cmd hal_hw_interface.joint1.pos-cmd => joint1-pos.in
net joint1-pos-fb joint1-pos.out => hal_hw_interface.joint1.pos-fb
# maxv = 90 deg./s; maxa = 45 deg./s/s
setp joint1-pos.maxv 0.785398
setp joint1-pos.maxa 0.392699
addf joint1-pos.funct robot_hw_thread
# joint 2
net joint2-pos-cmd hal_hw_interface.joint2.pos-cmd => joint2-pos.in
net joint2-pos-fb joint2-pos.out => hal_hw_interface.joint2.pos-fb
# maxv = 90 deg./s; maxa = 45 deg./s/s
setp joint2-pos.maxv 0.785398
setp joint2-pos.maxa 0.392699
addf joint2-pos.funct robot_hw_thread
# trigger for halscope
loadrt siggen names=scope-trig
net trig scope-trig.square
setp scope-trig.frequency 10
setp scope-trig.amplitude 1
addf scope-trig.update robot_hw_thread
# Start threads
start