Skip to content

Add semantic segmentation tutorial#136

Open
pepisg wants to merge 2 commits intoros-navigation:rollingfrom
pepisg:semantic-segmentation
Open

Add semantic segmentation tutorial#136
pepisg wants to merge 2 commits intoros-navigation:rollingfrom
pepisg:semantic-segmentation

Conversation

@pepisg
Copy link
Contributor

@pepisg pepisg commented Feb 18, 2026

Signed-off-by: pepisg <pedro.gonzalez@eia.edu.co>
Signed-off-by: pepisg <pedro.gonzalez@eia.edu.co>
Copy link
Member

@SteveMacenski SteveMacenski left a comment

Choose a reason for hiding this comment

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

Really just small stuff - thanks for this :-)

<name>nav2_semantic_segmentation_demo</name>
<version>0.0.0</version>
<description>Metapackage for semantic segmentation demo packages</description>
<maintainer email="user@example.com">User</maintainer>
Copy link
Member

Choose a reason for hiding this comment

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

populate :-)

Copy link
Member

Choose a reason for hiding this comment

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

Empty?

<name>semantic_segmentation_sim</name>
<version>0.0.0</version>
<description>Launch files and Gazebo worlds for semantic segmentation layer testing</description>
<maintainer email="user@example.com">User</maintainer>
Copy link
Member

Choose a reason for hiding this comment

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

:-)


### Training Your Own Model

1. Capture training images from Gazebo with varying lighting and environmental conditions
Copy link
Member

Choose a reason for hiding this comment

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

Does it need to be GZ or also real data?

Copy link
Member

Choose a reason for hiding this comment

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

Can you call out any changes from the default configs? It'll make it easier to update in the future if we know what changed

# Each entry maps a class name to its text prompt for GroundingDINO
classes:
- name: sidewalk
color: [255, 0, 0] # BGR format: Blue
Copy link
Member

Choose a reason for hiding this comment

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

Is this for parsing from the detection or just for visualization? This would be good to mention



class SegmentationNode(Node):
"""ROS2 node that performs semantic segmentation using ONNX Runtime."""
Copy link
Member

Choose a reason for hiding this comment

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

Question: is this dependent on platform / TRT versions / anything or a general purpose format? I just wanted to make sure its generalized (ish)

Comment on lines +40 to +45
providers = ['CUDAExecutionProvider', 'CPUExecutionProvider']
self.session = ort.InferenceSession(str(model_path), providers=providers)

# Get model device
provider = self.session.get_providers()[0]
self.get_logger().info(f'Using provider: {provider}')
Copy link
Member

Choose a reason for hiding this comment

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

Not used from the node's configuration YAML? I thought I saw a cpu/gpu param

@SteveMacenski
Copy link
Member

Question: I recently opened github.com/ros-navigation/navigation2.ai. Would parts of this fall into that? The costmap layer I know we've talked about (maybe submodule). But is the node sufficiently generic? It seems so.

I might have a few more scrutiny comments on it for efficiency if adding to github.com/ros-navigation/navigation2.ai, but if its general (i.e. any ONNX file works) then I think that would be a good not-just-tutorial contribution :-)

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

Comments