Skip to content

Commit f847afa

Browse files
committed
fixes
1 parent fedd633 commit f847afa

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
from handlers.handler import Handler
2-
2+
import numpy as np
33

44
class BallHandler(Handler):
55
def __init__(self, config):
66
super().__init__(config)
7-
self.ball_pos = None
7+
self._ball_pos = None
88

99
def ball_pos_callback(self, msg):
10-
self.ball_pos = msg
10+
self._ball_pos = msg
1111

1212
def has_data(self):
13-
return (self.ball_pos != None)
13+
return (self._ball_pos != None)
1414

1515
def get_ball_pos(self):
16-
return self.ball_pos
16+
ball_pos = np.array(
17+
[
18+
self._ball_pos.pose.position.x,
19+
self._ball_pos.pose.position.y,
20+
],
21+
dtype=np.float32,
22+
)
23+
return ball_pos

src/bitbots_motion/bitbots_rl_motion/nodes/rl_node.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def _timer_callback(self):
5050
# Prüfen ob alle Subscriber schon mindestens eine Nachricht hatten
5151
if not self._all_sensors_ready():
5252
self.get_logger().warning("Waiting for all sensors to be available", throttle_duration_sec=1.0)
53+
return
5354

5455
# TODO consider IMU mounting offset
5556

0 commit comments

Comments
 (0)