Skip to content

Commit cb1c29b

Browse files
committed
Merge branch 'feature/pi_plus' of github.com:bit-bots/bitbots_main into feature/pi_plus
2 parents 39451d8 + 9c1185d commit cb1c29b

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

src/bitbots_misc/bitbots_teleop/scripts/teleop_keyboard.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import rclpy
1313
from bitbots_utils.transforms import quat_from_yaw
1414
from geometry_msgs.msg import Point, Twist, Vector3
15+
from livelybot_msg.msg import PowerSwitch
1516
from rclpy.action import ActionClient
1617
from rclpy.node import Node
1718
from sensor_msgs.msg import JointState
@@ -23,15 +24,15 @@
2324
from bitbots_msgs.srv import SimulatorPush
2425

2526
msg = """
26-
BitBots Teleop
27-
--------------
27+
Bit-Bots Teleop
28+
---------------
2829
Walk around: Move head:
2930
q w e u i o
3031
a s d j k l
3132
m , .
3233
3334
q/e: turn left/right k: zero head position
34-
a/d: left/rigth i/,: up/down
35+
a/d: left/right i/,: up/down
3536
w/s: forward/back j/l: left/right
3637
u/o/m/.: combinations
3738
@@ -46,6 +47,7 @@
4647
b: kick left backward n: kick right backward
4748
B: kick left outward N: kick right outward
4849
50+
SPACE: EMERGENCY STOP!!!
4951
f: full stop F: play walkready animation
5052
r: reset robot in simulation
5153
R: reset ball in simulation
@@ -60,7 +62,7 @@
6062
6163
Pushing:
6264
p: execute Push
63-
Shift-p: reset Power to 0
65+
P: reset Power to 0
6466
ü/ä: increase/decrease power forward (x axis)
6567
+/#: increase/decrease power left (y axis)
6668
SHIFT increases/decreases with factor 10
@@ -153,6 +155,7 @@ def __init__(self):
153155
self.head_tilt_step = 0.05
154156

155157
self.walk_kick_pub = self.create_publisher(Bool, "kick", 1)
158+
self.power_switch_pub = self.create_publisher(PowerSwitch, "/power_switch_state", 1)
156159

157160
self.reset_robot = self.create_client(Empty, "/reset_pose")
158161
self.reset_ball = self.create_client(Empty, "/reset_ball")
@@ -330,6 +333,13 @@ def loop(self):
330333
elif key == "P":
331334
self.push_force_x = 0.0
332335
self.push_force_y = 0.0
336+
elif key == " ":
337+
self.x = 0
338+
self.y = 0
339+
self.z = 0
340+
self.a_x = 0
341+
self.th = 0
342+
self.power_switch_pub.publish(PowerSwitch(control_switch=0, power_switch=0))
333343
elif key == "ü":
334344
self.push_force_x += 1
335345
elif key == "Ü":

0 commit comments

Comments
 (0)