Skip to content

Conversation

@fred-labs
Copy link
Collaborator

@fred-labs fred-labs commented Oct 9, 2025

add pipeline command :

  1. variation -> fpm
  2. fpm -> json-ld
  3. json-ld -> artifacts (e.g. gazebo)

But it currently fails with

docker run -v ./rooms:/usr/src/app/models -v ./output:/usr/src/app/output --rm  -it floorplan pipeline -m /usr/src/app/models/rooms.variation -o /usr/src/app/output --targets gazebo -n 5
Blender 4.0.2

=== Step 1/3: Generating 5 variation(s) ===
Input: /usr/src/app/models/rooms.variation
Output: /usr/src/app/output/variations
Generating 5 variation(s) from /usr/src/app/models/rooms.variation
Output path: /usr/src/app/output/variations
✓ Generated 29 variation(s)

=== Step 2/3: Transforming variations to JSON-LD ===
[1/29] Transforming rooms_1081.fpm...
/usr/src/app/output/variations/rooms_1081.fpm /usr/src/app/output/json-ld/rooms_1081
✗ Error transforming rooms_1081.fpm: 'floorplan_dsl.classes.fpm2.floorplan.Space object' has no attribute 'pose'
Error: Transform failed: 'floorplan_dsl.classes.fpm2.floorplan.Space object' has no attribute 'pose'

Manually running the three steps succeeds. Maybe the error is related to parts of the app being initialized wrongly after the first step.

What is also working:

# 1. run step 1 (2+3 fails, but variant fpms are generated correctly)
docker run -v ./rooms:/usr/src/app/models -v ./output:/usr/src/app/output --rm  -it floorplan pipeline -m /usr/src/app/models/rooms.variation -o /usr/src/app/output --targets gazebo -n 5 --keep-intermediates

# 2. run step 2 manually
time docker run -v ./output/variations/:/usr/src/app/models -v ./output:/usr/src/app/output --rm  -it floorplan transform -m /usr/src/app/models/rooms_1260.fpm  -o /usr/src/app/output/json-ld/rooms_1260

# 3. disable step 2 in code: 
#                ctx.invoke(
#                    transform,
#                    model_path=fpm_file,
#                    output_path=variation_jsonld_path,
#                )
# run successfully 1 + 3 step
docker run -v ./rooms:/usr/src/app/models -v ./output:/usr/src/app/output --rm  -it floorplan pipeline -m /usr/src/app/models/rooms.variation -o /usr/src/app/output --targets gazebo -n 5

@argenos
Copy link
Member

argenos commented Oct 15, 2025

I can repro this, I'll report back when I figure out what's going on!

@argenos argenos changed the base branch from variation to devel October 15, 2025 09:57
@argenos
Copy link
Member

argenos commented Oct 15, 2025

I think I've found some clues to the error. The pose of a Space gets added as part of the processors once the model is parsed:

https://github.com/secorolab/FloorPlan-DSL/blob/0f8b1fcb511e7444ad862868401c4e24c6010dc8/src/floorplan_dsl/processors/semantics/fpm2.py#L31

Those processors are added when we register the language:

https://github.com/secorolab/FloorPlan-DSL/blob/0f8b1fcb511e7444ad862868401c4e24c6010dc8/src/floorplan_dsl/registration.py#L43

Possibly the cause is that we need to temporarily remove the processors to generate the variations (where we need the abstract syntax and not the concrete values):

https://github.com/secorolab/FloorPlan-DSL/blob/0f8b1fcb511e7444ad862868401c4e24c6010dc8/src/floorplan_dsl/generators/variations.py#L54-L55

I changed the base to devel after we merged #34, could you rebase? I'll test if my theory with the DSL is correct in the meantime.

argenos added a commit to secorolab/FloorPlan-DSL that referenced this pull request Oct 15, 2025
required=True,
help="Path to the .variation model file",
)
@click.option(
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if it would be possible to not duplicate the args in the pipeline command. I can't remember the specifics when I was testing a single command, but my suggestion if you have time to test would be:

  1. Move the config arg from the generate command to floorplan
  2. Check what is available inside ctx.default_map when you call it from the other commands. I vaguely remember you might need to access a parent ctx to get what is read from the config, at least for the current implementation.
  3. Change it so that it a) propagates down to the correct ctx of the child commands, or access it from the parent ctx (only) for the pipeline command

)
)

# Build graph from the JSON-LD directory
Copy link
Member

Choose a reason for hiding this comment

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

Avoid duplicating code here and call the respective commands instead

@argenos argenos mentioned this pull request Oct 15, 2025
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.

3 participants