|
12 | 12 | import rclpy |
13 | 13 | from bitbots_utils.transforms import quat_from_yaw |
14 | 14 | from geometry_msgs.msg import Point, Twist, Vector3 |
| 15 | +from livelybot_msg.msg import PowerSwitch |
15 | 16 | from rclpy.action import ActionClient |
16 | 17 | from rclpy.node import Node |
17 | 18 | from sensor_msgs.msg import JointState |
|
23 | 24 | from bitbots_msgs.srv import SimulatorPush |
24 | 25 |
|
25 | 26 | msg = """ |
26 | | -BitBots Teleop |
27 | | --------------- |
| 27 | +Bit-Bots Teleop |
| 28 | +--------------- |
28 | 29 | Walk around: Move head: |
29 | 30 | q w e u i o |
30 | 31 | a s d j k l |
31 | 32 | m , . |
32 | 33 |
|
33 | 34 | 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 |
35 | 36 | w/s: forward/back j/l: left/right |
36 | 37 | u/o/m/.: combinations |
37 | 38 |
|
|
46 | 47 | b: kick left backward n: kick right backward |
47 | 48 | B: kick left outward N: kick right outward |
48 | 49 |
|
| 50 | +SPACE: EMERGENCY STOP!!! |
49 | 51 | f: full stop F: play walkready animation |
50 | 52 | r: reset robot in simulation |
51 | 53 | R: reset ball in simulation |
|
60 | 62 |
|
61 | 63 | Pushing: |
62 | 64 | p: execute Push |
63 | | -Shift-p: reset Power to 0 |
| 65 | +P: reset Power to 0 |
64 | 66 | ü/ä: increase/decrease power forward (x axis) |
65 | 67 | +/#: increase/decrease power left (y axis) |
66 | 68 | SHIFT increases/decreases with factor 10 |
@@ -153,6 +155,7 @@ def __init__(self): |
153 | 155 | self.head_tilt_step = 0.05 |
154 | 156 |
|
155 | 157 | self.walk_kick_pub = self.create_publisher(Bool, "kick", 1) |
| 158 | + self.power_switch_pub = self.create_publisher(PowerSwitch, "/power_switch_state", 1) |
156 | 159 |
|
157 | 160 | self.reset_robot = self.create_client(Empty, "/reset_pose") |
158 | 161 | self.reset_ball = self.create_client(Empty, "/reset_ball") |
@@ -330,6 +333,13 @@ def loop(self): |
330 | 333 | elif key == "P": |
331 | 334 | self.push_force_x = 0.0 |
332 | 335 | 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)) |
333 | 343 | elif key == "ü": |
334 | 344 | self.push_force_x += 1 |
335 | 345 | elif key == "Ü": |
|
0 commit comments