Skip to content

selectively copy models and search for dependencies#93

Open
kevins4202 wants to merge 7 commits into
mainfrom
user/kevins4202/selective-model-copying
Open

selectively copy models and search for dependencies#93
kevins4202 wants to merge 7 commits into
mainfrom
user/kevins4202/selective-model-copying

Conversation

@kevins4202

Copy link
Copy Markdown
Contributor

#84 Lazily loads sim and PX4 models, searching recursively for dependencies

@kevins4202
kevins4202 marked this pull request as ready for review January 9, 2026 01:53
@kevins4202
kevins4202 requested a review from ethayu January 9, 2026 01:53
@ethayu

ethayu commented Jan 11, 2026

Copy link
Copy Markdown
Collaborator

instead of hardcoding in each worldnode file which models are used imo it'll be cleaner if there was some automatic way to do this

Eg if the models are already organized by competition in the models folder

Or if u search through the sim definition to see what models are used for that sim

@ethayu ethayu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we rename the file from HoopCourse.py to InHouse.py

and in general there will be 2 types of naming - the class name directly (invoked via self.__class__.__name__) and the camel_case version (so in_house in this case) - we use camel_case when referring to file names

"""

def __init__(self,
competition_name: str,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

competition_name should not exist as a parameter (if anything should be hardcoded for subclasses)

"""

def __init__(self, competition_name: str, output_filename: Optional[str] = None):
def __init__(self, competition_name: str):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah should not exist as a param

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry kevin for putting this on you i know you didn't write the code but pls make fix

output_filename: Optional custom output filename. If None, uses {competition_name}.sdf
"""
super().__init__(self.__class__.__name__)
self.competition_name = competition_name

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reference https://github.com/pennaerial/monorepo/blob/main/controls/sae_2025_ws/src/uav/uav/autonomous_modes/Mode.py to see how we refer to this sort of thing (we use self.__class__.__name__)

max_dist: 1
world_name: "src/sim/sim/world_gen/worlds/template.sdf" # Gazebo world template
# output_filename is optional - defaults to competition name
world_name: "world_gen/worlds/template.sdf" # Gazebo world template (relative to package root)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's have it always default to world_gen/worlds/{name of yaml} (so remove this param)

uav=self.uav,
num_hoops=self.num_hoops,
max_dist=self.max_dist,
course = AscentCourse(dlz=self.dlz,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for code cleanliness lets put these repeated params into a dict and pass into functions via **

response.hoop_positions.append(hp)
return response

def _validate_parameters(self):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm let's add this function into main WorldNode implementation

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change irrelevant to commit (remove)

Comment on lines +268 to +273
This function merges sim models (hoop, dlz, payload, etc.) with existing PX4 models
using dirs_exist_ok=True. It should be called *after* PX4 vehicle models are copied.

Model copying flow:
1. UAV launch: copy_px4_models() clears ~/.simulation-gazebo/models/ and copies PX4 vehicle models
2. WorldNode: This function merges sim models with existing PX4 models (dirs_exist_ok=True)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove llm context


return dependencies

def copy_px4_models(px4_path: str, models: list[str]) -> None:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this new function, sim package already downloads px4/gz models (

download_gz_models = ExecuteProcess(
)

@kevins4202
kevins4202 requested a review from ethayu January 16, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants