Skip to content

Commit cf75169

Browse files
cleanup
1 parent 153ce23 commit cf75169

2 files changed

Lines changed: 3 additions & 23 deletions

File tree

GEMstack/onboard/interface/gem_gazebo.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
from .gem import *
22
from ...utils import settings
33
import math
4-
import time
5-
import random
64

75
# ROS Headers
86
import rospy
@@ -92,7 +90,7 @@ def __init__(self):
9290
# Agent detection
9391
self.model_states_sub = None
9492
self.tracked_model_prefixes = settings.get('simulator.agent_tracker.model_prefixes',
95-
['pedestrian', 'person', 'bicycle', 'bike', 'car', 'vehicle', 'truck'])
93+
['pedestrian', 'bicycle', 'car'])
9694
self.agent_detector_callback = None
9795
self.last_agent_positions = {}
9896
self.last_agent_velocities = {}
@@ -183,7 +181,7 @@ def model_states_callback(self, msg: ModelStates):
183181

184182
# Create vehicle model pose in ABSOLUTE_CARTESIAN frame (Gazebo's native frame)
185183
self.vehicle_model_pose = ObjectPose(
186-
frame=ObjectFrameEnum.ABSOLUTE_CARTESIAN, # Gazebo uses its own coordinate system
184+
frame=ObjectFrameEnum.ABSOLUTE_CARTESIAN,
187185
t=current_time,
188186
x=vehicle_pos.x,
189187
y=vehicle_pos.y,
@@ -237,13 +235,9 @@ def model_states_callback(self, msg: ModelStates):
237235
quaternion = (orientation.x, orientation.y, orientation.z, orientation.w)
238236
roll, pitch, yaw = euler_from_quaternion(quaternion)
239237

240-
# Debug print occasionally
241-
if random.random() < 0.01: # 1% chance to print
242-
print(f"Agent {model_name} raw model_state position: ({position.x:.2f}, {position.y:.2f}, {position.z:.2f})")
243-
244238
# Create agent pose in ABSOLUTE_CARTESIAN frame (Gazebo's native frame)
245239
agent_global_pose = ObjectPose(
246-
frame=ObjectFrameEnum.ABSOLUTE_CARTESIAN, # Gazebo's coordinate system
240+
frame=ObjectFrameEnum.ABSOLUTE_CARTESIAN,
247241
t=current_time,
248242
x=position.x,
249243
y=position.y,
@@ -257,7 +251,6 @@ def model_states_callback(self, msg: ModelStates):
257251
agent_pose = None
258252
if self.transform_initialized:
259253
# Calculate agent position relative to the *initial* vehicle position (from when START frame was established)
260-
# This provides a stable transformation that doesn't change as the vehicle moves
261254
rel_x = position.x - self.initial_vehicle_model_pose.x
262255
rel_y = position.y - self.initial_vehicle_model_pose.y
263256
rel_z = position.z - self.initial_vehicle_model_pose.z
@@ -282,10 +275,6 @@ def model_states_callback(self, msg: ModelStates):
282275
pitch=pitch,
283276
yaw=rel_yaw
284277
)
285-
286-
# Debug print occasionally
287-
if random.random() < 0.01: # 1% chance to print
288-
print(f"Agent {model_name} stable relative position: ({rot_x:.2f}, {rot_y:.2f}, {rel_z:.2f})")
289278
else:
290279
# If transformation not initialized yet, just use the model_states pose
291280
agent_pose = agent_global_pose
@@ -315,10 +304,6 @@ def model_states_callback(self, msg: ModelStates):
315304
)
316305
else:
317306
velocity = calculated_vel
318-
319-
# Debug output for manual velocity calculation
320-
if np.linalg.norm(velocity) > 0.01:
321-
print(f"Calculated velocity for {model_name}: {velocity}")
322307

323308
# Determine activity state based on velocity magnitude
324309
velocity_magnitude = np.linalg.norm(velocity)

GEMstack/utils/mpl_visualization.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@ def plot_object(obj : PhysicalObject, axis_len=None, outline=True, bbox=True, ax
6969
R = obj.pose.rotation2d()
7070
t = [obj.pose.x,obj.pose.y]
7171

72-
# Debug print occasionally
73-
import random
74-
if random.random() < 0.02: # ~2% chance to print
75-
print(f"Plotting object at position ({obj.pose.x:.2f}, {obj.pose.y:.2f}) with frame {obj.pose.frame}")
76-
7772
if bbox or (outline and obj.outline is None):
7873
bounds = obj.bounds()
7974
(xmin,xmax),(ymin,ymax),(zmin,zmax) = bounds

0 commit comments

Comments
 (0)