Skip to content

add a wait to give TF time to be available#636

Merged
JWhitleyWork merged 1 commit into
v9.3from
wait-for-tf
May 22, 2026
Merged

add a wait to give TF time to be available#636
JWhitleyWork merged 1 commit into
v9.3from
wait-for-tf

Conversation

@marioprats

Copy link
Copy Markdown

In kinova_sim, Write PickNik, add a WaitForDuration after TF starts getting published, before starting the other parallel thread, to give some time for the TF to be broadcasted

Closes https://github.com/PickNikRobotics/moveit_pro/issues/19123

@marioprats marioprats requested a review from bkanator May 18, 2026 09:18
@bkanator

Copy link
Copy Markdown

this failed for me on this branch? I am on v9.3 for moveit_pro and on wait-for-tf for the example- ws
image

@bkanator

bkanator commented May 19, 2026

Copy link
Copy Markdown

note, it was successful on the second run.

This was the error when it fails:

[objective_server_node_main-6] [2026-05-19 16:54:19.950] [objective_server_node] [info] Objective `Write PickNik` starting at time: 1779209659.95051599 seconds.
[objective_server_node_main-6] [2026-05-19 16:54:19.972] [objective_server_node] [info] No controllers to switch after filtering already-active and already-inactive controllers.
[objective_server_node_main-6] Found path in 0 iterations (2.42e-07 s).
[objective_server_node_main-6] Path shortcutter: [X____________________________________X]
[ros2_control_node-15] [2026-05-19 16:54:20.619] [info] Received new action goal
[ros2_control_node-15] [2026-05-19 16:54:20.619] [info] Accepted new action goal
[ros2_control_node-15] [INFO] [1779209661.626163070] [MujocoSystem]: Mujoco model timestep not running in realtime. Increase the model timestep.
[ros2_control_node-15] [2026-05-19 16:54:22.142] [info] Path tolerance violated, trajectory will be aborted. Current joint deviations: [0.08488938177995173, 0.12185909170823747, 0.18814874922494873, 0.10358546701970717, 0.5003604510893271, 0.025114928040354534, 0.4663688743732166] Path tolerances: [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5]
[objective_server_node_main-6] [2026-05-19 16:54:22.400] [objective_server_node] [error] ExecuteTrajectory Error: Controller aborted sub-trajectory 0: Path tolerance violated.
[objective_server_node_main-6] [2026-05-19 16:54:22.400] [objective_server_node] [error] Execution of Behavior Tree for Objective `Write PickNik` did not succeed at time: 1779209662.40074563 seconds

@marioprats

Copy link
Copy Markdown
Author

@bkanator the path tolerance violation is a different issue, probably because Mujoco is being slow - it can't track the path below the configured tolerance

@bkanator

bkanator commented May 21, 2026

Copy link
Copy Markdown

I think this is a timing thing? but, the wait should be moved up.

----- below from claude ---

WaitForDuration fix from PR #636 that fix is scoped to inside the Parallel block (for TF propagation of the static frame). But the failure is happening at the very first node: Move to Waypoint → Home, which runs before any of that.

Root cause: This is a classic robot state initialization timing issue in MuJoCo sim. On first
objective run, MoveIt hasn't yet received/incorporated the robot's joint states from the simulator
into its planning scene. Planning for Move to Waypoint fails because there's no valid current
joint state. On the second run, joint states are flowing, so it succeeds.

The WaitForDuration added in PR #636 helps with the TF for the Cartesian path, but it's placed
after Move to Waypoint (inside the Parallel block), so it doesn't fix this initial failure.

Two options for fixing this:

Option A — Add a WaitForDuration at the top of the sequence (simple, reliable):



...

Option B — Wrap Move to Waypoint in RetryUntilSuccessful (cleaner UX, self-healing):


Option A is simpler and more predictable. Option B is more robust but hides the latency. I'd lean
toward A if there's a reliable warm-up time, or B if the timing varies.

Worth noting this affects all objectives that start with a Move to Waypoint in kinova_sim — it
might be worth a comment in the PR that the WaitForDuration placement doesn't cover the first-move
failure.

Screenshot from 2026-05-21 10-34-06

@JWhitleyWork JWhitleyWork added this to the 9.3.1 milestone May 21, 2026
@JWhitleyWork

Copy link
Copy Markdown
Member

Bumping to 9.3.1.

@marioprats

marioprats commented May 22, 2026

Copy link
Copy Markdown
Author

@bkanator I think we may be conflating two different issues here.
The original issue was about VisualizePath failing because TF is not available (published in a different thread in the Objective). This PR has a fix for that. It can't be moved before the "Move To Waypoint", because that's outside the Parallel node (before it starts), so that wouldn't fix the issue.

The path tolerance during "Move To Waypoint" is a different issue than can happen sometimes in systems where Mujoco is being slow. The solution to that is different - probably just increase the allowed path tolerance in the controller config - but we can do that in a different PR if you keep seeing it

@bkanator

Copy link
Copy Markdown

@bkanator I think we may be conflating two different issues here. The original issue was about VisualizePath failing because TF is not available (published in a different thread in the Objective). This PR has a fix for that. It can't be moved before the "Move To Waypoint", because that's outside the Parallel node (before it starts), so that wouldn't fix the issue.

The path tolerance during "Move To Waypoint" is a different issue than can happen sometimes in systems where Mujoco is being slow. The solution to that is different - probably just increase the allowed path tolerance in the controller config - but we can do that in a different PR if you keep seeing it

Yes! multi-tasking is not working well for me. In my brain I was thinking, 'test this to see if it fails', you are correct it is a different issue.

@JWhitleyWork JWhitleyWork merged commit a009af4 into v9.3 May 22, 2026
4 checks passed
@JWhitleyWork JWhitleyWork deleted the wait-for-tf branch May 22, 2026 14:26
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