Conversation
Greptile SummaryThis PR adds a test file that generates realistic trajectories on a costmap using A* pathfinding and smooth path resampling.
Confidence Score: 4/5
Important Files Changed
Last reviewed commit: 1800508 |
| @pytest.fixture(scope="session") | ||
| def get_moment(): | ||
| @functools.lru_cache(maxsize=1) | ||
| def moment_provider(seek=10.0) -> Moment: |
There was a problem hiding this comment.
seek parameter is unused
| 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() |
There was a problem hiding this comment.
use t.stop() instead of directly accessing t.lcm.stop() to maintain proper encapsulation
| 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!
| 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() |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
rerun-bridgepytest dimos/control/test_trajectory.pyshows 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