Skip to content

generate simple irl trajectory#1375

Draft
leshy wants to merge 2 commits intodevfrom
ivan/feat/trajectory-test-sketch
Draft

generate simple irl trajectory#1375
leshy wants to merge 2 commits intodevfrom
ivan/feat/trajectory-test-sketch

Conversation

@leshy
Copy link
Contributor

@leshy leshy commented Feb 27, 2026

rerun-bridge
pytest dimos/control/test_trajectory.py

shows you an actual path on a costmap

doesn't generate actual posestamped with useful timings (to go slow around obstacles)

but you have all the data required to make this happen, once precision of control is known,

you can do something like

path_with_speed = calculate_speed(precision_vs_speed_graph, path, costmap)

idk how you want to encode speed, since timings are absolute, feels weird to have them on a long path due to cummulative error.

also deletes a weird unitree shim
https://discord.com/channels/1341146487186391173/1357833666751107174/1476833497074106439

2026-02-27_14-36

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 27, 2026

Greptile Summary

This PR adds a test file that generates realistic trajectories on a costmap using A* pathfinding and smooth path resampling.

  • Integrates voxel mapping, occupancy grid generation, and navigation systems
  • Uses unitree_go2_bigoffice dataset for realistic IRL trajectory testing
  • Publishes generated maps and paths via LCM for visualization with rerun-bridge
  • As noted in the PR description, timing information is not yet implemented but data is available for future speed calculation based on precision requirements

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk - it only adds a test file with no production code changes
  • Score reflects that this is a test-only addition with minor style issues but no logical errors or bugs. The code correctly integrates existing systems and provides useful visualization capability for trajectory validation.
  • No files require special attention - the style improvements suggested are minor and optional

Important Files Changed

Filename Overview
dimos/control/test_trajectory.py Adds test for trajectory generation on costmap with A* pathfinding and smooth resampling; minor unused parameter issue

Last reviewed commit: 1800508

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@pytest.fixture(scope="session")
def get_moment():
@functools.lru_cache(maxsize=1)
def moment_provider(seek=10.0) -> Moment:
Copy link
Contributor

Choose a reason for hiding this comment

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

seek parameter is unused

Suggested change
def moment_provider(seek=10.0) -> Moment:
def moment_provider() -> Moment:

for key, value in moment.items():
t = LCMTransport(f"/{key}", type(value))
t.publish(value)
t.lcm.stop()
Copy link
Contributor

Choose a reason for hiding this comment

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

use t.stop() instead of directly accessing t.lcm.stop() to maintain proper encapsulation

Suggested change
t.lcm.stop()
t.stop()

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +47 to +57
data_dir = "unitree_go2_bigoffice"
get_data(data_dir)

lidar_data = TimedSensorReplay(f"{data_dir}/lidar")

voxels = VoxelGridMapper()

for frame in lidar_data:
voxels.add_frame(frame)

global_map = voxels.get_global_pointcloud2()
Copy link
Contributor

@paul-nechifor paul-nechifor Feb 27, 2026

Choose a reason for hiding this comment

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

Instead of reconstructing the point cloud, you can get it from this existing fixture (which you might have to move):

@pytest.fixture
def big_office() -> PointCloud:
    return read_pointcloud(get_data("big_office.ply"))

It was created from unitree_go2_bigoffice.

It's in dimos/mapping/pointclouds/test_occupancy.py

Copy link
Contributor Author

@leshy leshy Feb 28, 2026

Choose a reason for hiding this comment

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

yup mustafa can rewrite if he needs to, just wanted to sketch for him getting a path, good to know, didn't know we store a full pcd

@paul-nechifor paul-nechifor marked this pull request as draft February 28, 2026 06:51
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