# Get Waypoint name

**URL:** <https://forum.universal-robots.com/t/get-waypoint-name/38177>\
**Category:** URCaps SDK\
**Created:** [January 22, 2025, 10:37am UTC](https://forum.universal-robots.com/t/get-waypoint-name/38177 "2025-01-22T10:37:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![claudia](https://avatars.discourse-cdn.com/v4/letter/c/a88e57/32.png) [@claudia](https://forum.universal-robots.com/u/claudia)\
**Post date:** [January 22, 2025, 10:37am UTC](https://forum.universal-robots.com/t/get-waypoint-name/38177/1 "2025-01-22T10:37:32Z")

</div>

I’m working on a URCap where I need to collect the names of all waypoint that are children of my URcap node. I can successfully traverse the waypoint children using the code below and retrieve their poses (for fixed\_position waypoints). However, I’m unsure how to retrieve the names of these waypoints as they appear in the program tree.

```auto
     
root.traverse(new ProgramNodeVisitor() {
			@Override
			public void visit(WaypointNode programNode, int index, int depth) {
                    // I can access the pose of FIXED_POSITION waypoints
					if (programNode.getConfig().getConfigType() == ConfigType.FIXED_POSITION) { 
						try {
						FixedPositionDefinedWaypointNodeConfig cfg = (FixedPositionDefinedWaypointNodeConfig)programNode.getConfig();
						Pose pose = cfg.getPose();
						} catch (Exception e) {}
					}

                    // I cannot find a function like this one to get the waypoint name
					String name = programNode.getName();
				};
		});

```

Is there a way to achieve this? Any guidance would be appreciated!

---

<div class="post-metadata">

**Author:** ![claudia](https://avatars.discourse-cdn.com/v4/letter/c/a88e57/32.png) [@claudia](https://forum.universal-robots.com/u/claudia)\
**Post date:** [February 12, 2025, 2:23pm UTC](https://forum.universal-robots.com/t/get-waypoint-name/38177/2 "2025-02-12T14:23:06Z")

</div>

In case anyone faces the same issue, I found a solution. The `toString()` function of the `Object` class, which typically returns a string in the format `class name + @ + hash code`, has been overridden for objects of type `WaypointNode` to return the name of the waypoint as it appears in the program tree
