Tutorial fixes and additions: build deps, path optimization, Gazebo execution#165
Open
psardin001 wants to merge 10 commits intohumanoid-path-planner:develfrom
Open
Tutorial fixes and additions: build deps, path optimization, Gazebo execution#165psardin001 wants to merge 10 commits intohumanoid-path-planner:develfrom
psardin001 wants to merge 10 commits intohumanoid-path-planner:develfrom
Conversation
…celeration - Move obstacle to [0.5, -0.2, 1.2] so it blocks the straight-line path - Add RandomShortcut path optimization before time parameterization - Use maxAcceleration=0.5 for slower, more visible motions - Document that effortScale requires mass/inertia data (disabled for Staubli)
- tutorial_6: Dockerfile, controllers, init.py, launch_sim.py - CMakeLists: install rules for tutorial_6 and tutorial_7 - Makefile: add hpp-core, hpp-manipulation, hpp-exec build targets - README: update tutorial 6 description, add tutorial 7 - tutorial_5: remove duplicate graph.initialize() - run_docker.sh: fix executable permission
robotpkg hpp-core/hpp-manipulation headers were shadowing the devel versions built from source, causing compilation failures in hpp-python. Remove robotpkg packages that overlap with source-built ones from the Dockerfile and add hpp-manipulation-urdf to the Makefile with proper dependency chain, so each package comes from exactly one source. Test build — to be validated.
qgv has no hpp dependency, safe to keep from robotpkg binary. Remove qgv source build from Makefile, add robotpkg-qt5-qgv to Dockerfile.
[tutorial_5] Set constraint graph on problem before optimization
for more information, see https://pre-commit.ci
florent-lamiraux
requested changes
Apr 14, 2026
Comment on lines
80
to
87
| toppra_repository=https://github.com/hungpham2511 | ||
| toppra_branch=develop | ||
| toppra_extra_flags= -DBUILD_TESTS=OFF -DPYTHON_BINDINGS=OFF | ||
|
|
||
| hpp-toppra_repository=${HPP_REPO} | ||
| hpp-toppra_branch=main | ||
| hpp-toppra_extra_flags= | ||
|
|
Contributor
There was a problem hiding this comment.
Suggested change
| toppra_repository=${HPP_REPO} | |
| toppra_branch=main | |
| toppra_extra_flags= -DBUILD_TESTS=OFF -DPYTHON_BINDINGS=OFF | |
| hpp-toppra_repository=${HPP_REPO} | |
| hpp-toppra_branch=devel | |
| hpp-toppra_extra_flags= | |
| `RandomShortcut` repeatedly picks two random points along the path and tries to connect them with a | ||
| straight segment. If the shortcut is collision-free and shorter, it replaces the original sub-path. | ||
|
|
||
| ## SimpleTimeParameterization |
Contributor
There was a problem hiding this comment.
Suggested change
| ## SimpleTimeParameterization | |
| ## Time parameterization | |
| ### SimpleTimeParameterization |
| print(f" maxAcceleration={acc:.2f} -> duration={p.length():.3f} s") | ||
| ``` | ||
|
|
||
| ## TOPPRA |
Contributor
There was a problem hiding this comment.
Suggested change
| ## TOPPRA | |
| ### TOPPRA |
Comment on lines
+28
to
+33
| ```python | ||
| from pyhpp.core import RandomShortcut | ||
|
|
||
| shortcut = RandomShortcut(problem) | ||
| p1_opt = shortcut.optimize(p1) | ||
| print(f"Optimized path length: {p1_opt.length():.3f} (was {p1.length():.3f})") |
Contributor
There was a problem hiding this comment.
This portion of code is already in init.py. For consistency with other tutorials, it would be better to
- remove it from the script or
- move it in a section "Explaining the code".
Comment on lines
+98
to
+99
| TOPPRA typically produces shorter execution times than `SimpleTimeParameterization` because it | ||
| computes the time-optimal solution rather than a conservative polynomial approximation. |
Contributor
There was a problem hiding this comment.
Actually, TOPPRA does not stop at waypoint, making the velocity discontinuous. We need to better understand how those algorithms work.
Probably, TOPPRA should be used after SplineGradientBased_bezier3.
| stp.safety = 0.95 | ||
| stp.maxAcceleration = 0.5 | ||
| p1_stp = stp.optimize(p1_opt) | ||
| print(f"STP duration: {p1_stp.length():.3f} s (maxAcceleration=0.5)") |
Contributor
There was a problem hiding this comment.
Suggested change
| print(f"STP duration: {p1_stp.length():.3f} s (maxAcceleration=0.5)") | |
| print(f"STP duration: {p1_stp.length():.3f} s (maxAcceleration=0.5)") | |
| In a separate file `plot.py`, we could add the following function that plots the trajectory, velocity and accelerations. This implies installing `matplotlib` in the docker image | |
| import matplotlib.pyplot as plt | |
| # Plot a trajectory with respect to times | |
| # | |
| # \param p pyhpp.core.Path instance | |
| # \param rmin, rmax: range of the path to be plot. For example passing rmin=0, rmax=6 will | |
| # plot the 6 first coordinates of the path, | |
| # \param dt: time step, | |
| # \param order: 0 for configuration, 1 for configuration and velocity, 2 for configuration | |
| # velocity and acceleration | |
| def plotTraj(p, rmin, rmax, dt = 0.01, order = 2): | |
| times = dt * np.arange(int(p.length()/dt)) | |
| fig = plt.figure(layout = "constrained") | |
| gs = fig.add_gridspec(order+1,1) | |
| values = np.array([p.eval(t)[0] for t in times]) | |
| ax0 = fig.add_subplot(gs[0,0]) | |
| if order >= 1: | |
| velocities = np.array([p.derivative(t,1) for t in times]) | |
| ax1 = fig.add_subplot(gs[1,0]) | |
| if order >= 2: | |
| accelerations = np.array([p.derivative(t,2) for t in times]) | |
| ax2 = fig.add_subplot(gs[2,0]) | |
| for i in range(rmin, rmax): | |
| ax0.plot(times, values[:,i], label=f"q{i}") | |
| if order >= 1: | |
| ax1.plot(times, velocities[:,i], label=f"q{i}") | |
| if order >= 2: | |
| ax2.plot(times, accelerations[:,i], label=f"q{i}") | |
| fig.show() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tutorial_1 : build fixes
qttools5-devdependency and fixhpp-plotdependency chain--system-site-packagesto the python venvqgvfrom robotpkg instead of building from sourcecompilation failures in hpp-python)
tutorial_5 : path optimization
tutorial_6 : Gazebo execution (new)
Execute HPP-generated motions on a simulated robot via
hpp_exec