Skip to content

Conversation

@jimsynz
Copy link
Contributor

@jimsynz jimsynz commented Dec 16, 2025

Summary

  • Add BB.Motion module that bridges IK solving and actuator commands
  • Add BB.Motion.Tracker behaviour for continuous position tracking
  • Add BB.Command.MoveTo for built-in move command
  • Add BB.IK.Solver behaviour for pluggable IK solvers
  • Fix message schemas to allow nil for optional fields
  • Update IK tutorial with Motion API documentation

Changes

BB.Motion

  • move_to/4 - solve IK, update state, send actuator commands
  • solve_only/4 - solve without sending commands (for validation)
  • send_positions/3 - send pre-computed positions to actuators
  • move_to_multi/3 and solve_only_multi/3 for coordinated motion (gait generators)
  • Multi-target solving uses Task.async_stream with Enum.reduce_while for parallel execution

BB.Command.MoveTo

  • Supports single target mode (:target, :target_link, :solver)
  • Supports multi-target mode (:targets map, :solver)

Message Schema Fixes

  • Hold, Stop, Position commands now accept nil for optional fields like command_id, velocity, duration

Test plan

  • Run mix check --no-retry - all checks pass
  • 18 new tests for Motion and MoveTo
  • Verify multi-target parallel solving works correctly

Add BB.Motion module that bridges IK solving and actuator commands:
- `move_to/4` - solve IK, update state, send actuator commands
- `solve_only/4` - solve without sending commands (for validation)
- `send_positions/3` - send pre-computed positions to actuators
- Multi-target variants for coordinated motion (gait generators)

Add BB.Motion.Tracker behaviour for continuous position tracking.

Add BB.Command.MoveTo for built-in move command with single and
multi-target support.

Add BB.IK.Solver behaviour defining the pluggable IK solver interface.

Fix message schemas to allow nil for optional fields (command_id,
velocity, duration) using `{:or, [nil, type]}` instead of filtering.

Update IK tutorial with Motion API documentation.
…ormats

- Motion.move_to now publishes JointState messages on :sensor/:motion
- MoveTo command accepts Point3D messages and {:vec3, x, y, z} tuples
- DSL argument types now support flexible formats (maps, enums, modules)
- Add BB.Message.Geometry.Point3D for 3D coordinate messages
Spark doesn't support multi-line strings in option docs. Moved the
detailed type documentation to the entity's docs field instead.
…dates

The tutorial was showing State.set_positions which bypasses the
actuator layer. Updated examples to either just show solving (for
validation) or point to the Motion API for actually moving the robot.
@jimsynz jimsynz merged commit 9be282a into main Dec 17, 2025
14 checks passed
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