Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
238 commits
Select commit Hold shift + click to select a range
e4a9f9f
Reposition in_front_of_face_wall to account for extra length of Artic…
jjaime2 Apr 2, 2025
ac74b5c
Use tool_tip frame instead of forkTip, and use jaco_arm_with_articuto…
jjaime2 Apr 2, 2025
161c71e
Update planner_benchmark.py to use jaco_arm_with_articutool planning …
jjaime2 Apr 8, 2025
0d360b2
Adjust above plate configuration to account for extra Articutool length
jjaime2 Apr 8, 2025
6a3379d
Add GetJointStates behavior to read from the global /joint_states top…
jjaime2 Apr 11, 2025
eb9fff8
Remove unused imports
jjaime2 Apr 11, 2025
d2965a9
Use main node to read joint states, and update logic of GetJointState…
jjaime2 Apr 11, 2025
049a394
Use proper BlackboardKey for output of joint states behavior
jjaime2 Apr 11, 2025
c968f82
Write to correct goal_constraints BlackboardKey
jjaime2 Apr 11, 2025
aefc7b2
Return GetJointStates behavior result as two lists for joint_names an…
jjaime2 Apr 13, 2025
7b40e8f
Add Articutool joints to MoveIt2 object. We can and should do this mo…
jjaime2 Apr 13, 2025
01bc598
Update error logging for missing arguments in each constraint type so…
jjaime2 Apr 13, 2025
65f314a
Revert adding Articutool joint constraints in the acquire food behavi…
jjaime2 Apr 13, 2025
eaad944
Add Articutool joint constraints when planning for a MoveToConfigurat…
jjaime2 Apr 13, 2025
365d1ea
Separate blackboard keys between constraints to avoid conflicts
jjaime2 Apr 13, 2025
c50eef7
Add Articutool joint constraints to motions that go to pre-defined co…
jjaime2 Apr 15, 2025
f76ef77
Modify get_moveit2_object to allow for planning with any group. A uni…
jjaime2 Apr 18, 2025
3c19625
Add group_name parameter to MoveIt2 constrain, plan, and execute beha…
jjaime2 Apr 18, 2025
c13de2f
For motions that simply move to a predefined configuration, we use th…
jjaime2 Apr 18, 2025
24a9121
Add MoveIt2ComputeIK behavior
jjaime2 Apr 18, 2025
4dc443f
Add StampPoseFromPose behavior that adds a frame ID to an unstamped Pose
jjaime2 Apr 19, 2025
a638694
Update MoveIt2ComputeIK
jjaime2 Apr 19, 2025
d5c2aa7
Add StampPoseFromPose to __init__ so that it can be imported locally
jjaime2 Apr 19, 2025
e4bfc9c
Request latest transform to get an up to date timestamp when applying…
jjaime2 Apr 19, 2025
31abe63
Add ExtractJointsFromState behavior
jjaime2 Apr 19, 2025
4f82610
(WIP) Rework move above plan to achieve desired pose by defining join…
jjaime2 Apr 19, 2025
cff7009
Add move above plan for Articutool joints
jjaime2 Apr 19, 2025
96eec30
Add ExecuteArticutoolTrajectory behavior
jjaime2 Apr 19, 2025
5432513
Execute Articutool trajectory in move above behavior
jjaime2 Apr 19, 2025
136ddff
Pre-compute move above plan for Jaco arm and Articutool
jjaime2 Apr 19, 2025
a411bf2
(WIP) Switch back to the previous pose constraint for the move into c…
jjaime2 Apr 20, 2025
5fc1c91
Combine Jaco arm and Articutool joint states to pass as start joint s…
jjaime2 Apr 20, 2025
7d91e50
Use test into Articutool joint state to constrain Cartesian move into…
jjaime2 Apr 20, 2025
f9eb413
Disable move into path constraints temporarily. Holding the Articutoo…
jjaime2 Apr 20, 2025
3c08e2b
Add MoveIt2ComputeFK behavior
jjaime2 Apr 21, 2025
54df371
Run pre-commit
jjaime2 Apr 21, 2025
e295e6a
Implement behavior to extract a particular pose from a list of poses …
jjaime2 Apr 21, 2025
0e3e735
(WIP) Working towards optimization-based solution where we find a goo…
jjaime2 Apr 21, 2025
bce0109
Modify MoveIt2ComputeIK to accept MoveIt2_X_Constraints, and apply an…
jjaime2 Apr 21, 2025
6b82d53
Increase planning time for Move Above
jjaime2 Apr 21, 2025
38931ee
Temporarily disable max_path_len for j2n6s200_joint_1 and j2n6s200_jo…
jjaime2 Apr 22, 2025
ba8e3b3
Re-enable move into motion, but don't replan beforehand
jjaime2 Apr 24, 2025
a0bd4cf
Add behavior to call the SetOrientationControl service on the Articut…
jjaime2 Apr 24, 2025
c1c9e6e
Add behavior to switch the Articutool's controller, and activate the …
jjaime2 Apr 25, 2025
c2079e2
Re-enable grasp and extract twists, we may need to revisit how these …
jjaime2 Apr 25, 2025
2795ddd
Restore resting position behavior. Add behavior to extract components…
jjaime2 Apr 25, 2025
d525e4b
Change CallSetOrientationControl to accept a quaternion (object, tupl…
jjaime2 Apr 25, 2025
9a1a41b
After bite acquisition, and before moving to the resting configuratio…
jjaime2 Apr 30, 2025
08c4e6b
Disable Articutool orientation control after completing a MoveTo action
jjaime2 Apr 30, 2025
11d7289
Reinstate max_path_len_joint for Jaco joint 1 and 2, but increase lim…
jjaime2 May 1, 2025
eb337ac
Adjust Jaco joint 2 limits for planning
jjaime2 May 1, 2025
6f92d04
Specify jaco_arm group when planning recovery motion
jjaime2 May 1, 2025
1908fab
Remove exc_info
jjaime2 May 1, 2025
6b5e569
Return aggregate JointState from GetJointStates behavior, and use cur…
jjaime2 May 1, 2025
1f7cd6a
Revert planner_benchmark default MoveIt2 object to jaco_arm
jjaime2 May 10, 2025
026146b
Add planning benchmark for orientation constrained motions between pr…
jjaime2 May 11, 2025
5f0fc24
Modify orientation constrained planner benchmark to also save traject…
jjaime2 May 11, 2025
5d04ce3
WIP Add script to visualize saved trajectories with Pinocchio and Mes…
jjaime2 May 11, 2025
6bc2ebf
Modify trajectory visualization script to handle different joint type…
jjaime2 May 11, 2025
10fdeb3
Modify benchmark to test constrained planning from each configuration…
jjaime2 May 11, 2025
bd70f75
Address issue where continuous joints reported joint states that were…
jjaime2 May 11, 2025
88c8dae
Enable multiple planning attempts for unconstrained motions to nomina…
jjaime2 May 11, 2025
64c2955
Add metrics for Articutool feasibility, and add a script to analyze t…
jjaime2 May 14, 2025
4624a51
Remove wrist constraints for MoveAbove IK solution
jjaime2 May 15, 2025
c5db4a1
Add behavior to measure the manipulability of the Jaco arm along a pa…
jjaime2 May 15, 2025
f900d26
Disable orientation control service call for now, we'll find another …
jjaime2 May 17, 2025
d43491d
Separate move_above_plan into three distinct sequences, pre_acquisiti…
jjaime2 May 18, 2025
6930f5a
Add behavior to load Pinocchio model of full Jaco arm and Articutool …
jjaime2 May 18, 2025
d3244e2
Add behavior to check the kinematic feasibility of the Articutool ach…
jjaime2 May 18, 2025
99e6893
Add initial imports
jjaime2 May 18, 2025
bfad643
(WIP) Incorporate Articutool kinematic feasibility check. Currently, …
jjaime2 May 18, 2025
8e1a493
Bug fixes in load_pinocchio_model.py
jjaime2 May 18, 2025
88da136
Integrate behavior to load pinocchio model for re-use in other behavi…
jjaime2 May 18, 2025
5621001
Update CheckJacoDirectionalManipulability to use the pre-loaded Pinoc…
jjaime2 May 18, 2025
234671b
Remove logs because I don't want to pass the joint names as an input
jjaime2 May 18, 2025
7a52235
Update CheckArticutoolPathOrientationFeasibility behavior to use pre-…
jjaime2 May 18, 2025
5cd3cd1
Update CallSetOrientationControl to adhere to new interface
jjaime2 May 19, 2025
172fccd
Remove lingering call to CallSetOrientationControl
jjaime2 May 22, 2025
94c854c
Add behavior to adjust food frame for scooping so that we don't attem…
jjaime2 May 23, 2025
efe8c6a
Add a scooping action. I haven't verified this, but we can adjust it …
jjaime2 May 23, 2025
dc1081a
Add blackboard to set_static_tf call
jjaime2 May 23, 2025
fdf8ada
Update visualization script to take joint state in JSON format to vis…
jjaime2 May 23, 2025
35ef89a
Update scooping motion, now that I verified the orientation is correct
jjaime2 May 23, 2025
e0d2226
Replace AdjustFoodFrameYawForScoopingApproach behavior with the Rotat…
jjaime2 May 23, 2025
d7efac9
Reformat moveit2_compute_ik, and add a log to see the result
jjaime2 May 23, 2025
87fd61c
Re-enable MoveAbove and MoveInto motions without explicit orientation…
jjaime2 May 23, 2025
991f355
Add behavior to compute joint configuration for Articutool to achieve…
jjaime2 May 24, 2025
7ce9e4f
Add behavior to trigger Articutool IMU calibration
jjaime2 May 24, 2025
1db6413
Minor fixes
jjaime2 May 24, 2025
8ac9bf5
Enable MODE_FULL_ORIENATION control for Articutool before moving into…
jjaime2 May 24, 2025
8252919
Enable MODE_LEVELING after achieving level Articutool orientation
jjaime2 May 24, 2025
d4e7b66
Abstract post-acquisition Articutool self-leveling into separate sequ…
jjaime2 May 28, 2025
1dd8cbe
Explicitly disable orientation control post-acquisition to ensure cle…
jjaime2 May 28, 2025
8e86fee
Execute MoveAbove trajectory for Articutool first, then Jaco arm
jjaime2 May 28, 2025
9502107
Update default service name for setting orientation control mode
jjaime2 May 29, 2025
51a740e
Disable octomap
jjaime2 May 29, 2025
32a8eb7
Disable ADA specific configurations
jjaime2 Jun 1, 2025
dfdabae
Remove ft screen sessions since this F/T data reading and publishing …
jjaime2 Jun 1, 2025
9861670
Update F/T topics
jjaime2 Jun 1, 2025
a84cb24
Compute leveling joints for the Articutool at the end of the MoveInto…
jjaime2 Jun 2, 2025
854a41e
Add retries for move above and into planning sequences
jjaime2 Jun 2, 2025
8001230
Refactor(ExecuteArticutoolTrajectory): Simplify and improve robustness
jjaime2 Jun 2, 2025
5ccbceb
Add small delay to allow IMU to settle after motion for reliable cali…
jjaime2 Jun 3, 2025
a6a739a
Add end_effector_tool args to define from start.py
jjaime2 Jun 5, 2025
8bdd57d
Fix choice list for tool
jjaime2 Jun 5, 2025
5771ab4
Add liquid scooping action with spoon
jjaime2 Jun 5, 2025
0530a12
Disable orientation control before executing acquisition motions
jjaime2 Jun 5, 2025
81e5901
Add space
jjaime2 Jun 5, 2025
4de0d90
Restore old joint limits
jjaime2 Jun 5, 2025
e4d9edf
Add argument to define action from start.py
jjaime2 Jun 5, 2025
543fb42
Reduce extract duration for spoon scooping. This helps a bit to retai…
jjaime2 Jun 5, 2025
d015311
Add screen session for articutool mock
jjaime2 Jun 10, 2025
d2d8fa7
Add articutool system launch to start.py for sim real
jjaime2 Jun 10, 2025
00371bd
Add action to scoop granular foods
jjaime2 Jun 13, 2025
057b6da
Add behavior to execute a named Articutool primitive
jjaime2 Jun 14, 2025
a3dec08
feat(Acquisition): Integrate configurable primitives into action schema
jjaime2 Jun 14, 2025
17e702d
Incorporate food frame rotation to align with robot base inside the C…
jjaime2 Jun 14, 2025
337fcc8
Add behavior to conditionally modify the food frame to align with the…
jjaime2 Jun 15, 2025
4053ce1
Add orientation constraint for MoveAbove trajectory
jjaime2 Jun 29, 2025
e1e70a9
Update CheckArticutoolPathOrientationFeasibility behavior to ensure l…
jjaime2 Jun 29, 2025
d036b59
Add feasibility check for leveling
jjaime2 Jun 29, 2025
acde1f4
Add leveling feasibility check for resting trajectory
jjaime2 Jun 29, 2025
8d7f41b
Add leveling feasibility check to MoveToConfigurationWithWheelchairWa…
jjaime2 Jun 30, 2025
8531e9e
Update leveling feasibility check
jjaime2 Jun 30, 2025
08667c3
Rename articutool screen session
jjaime2 Jul 1, 2025
a8d5dc8
Adjust granular scooping action
jjaime2 Jul 8, 2025
dd76d2d
Fix IK joint constraints
jjaime2 Jul 9, 2025
96d6bb7
Add behaviors for ExtractPoseFromTransformStamped and OffsetPositionF…
jjaime2 Jul 9, 2025
6e5c0f6
Reduce Jaco joint 2 max path length when planning for MoveAbove pose.…
jjaime2 Jul 9, 2025
f64dd35
Add Articutool joint constraints for MoveAbove motion to encourage IK…
jjaime2 Jul 9, 2025
9eac749
Revert to using the VIBRATE_ROLL primitive for the spoon granular sco…
jjaime2 Jul 9, 2025
533a59f
Significantly increase the number of retries for the MoveAbove and Mo…
jjaime2 Jul 9, 2025
6ebb050
Adjust force/torque thresholds for granular scoop so that it can work…
jjaime2 Jul 15, 2025
e8c28b7
Add behavior to perform dynamic feasibility check on trajectories gen…
jjaime2 Jul 16, 2025
183ea4e
Update visualization script
jjaime2 Jul 19, 2025
63c2a71
Add action for granular + liquid scoop with spoon
jjaime2 Jul 20, 2025
e5f7d15
Run formatting
jjaime2 Jul 20, 2025
9253e4e
Add a benchmarking script that tests the feasibility checks utilized …
jjaime2 Jul 20, 2025
ae5a12f
Add benchmark to evaluate feasibility checks when the Jaco arm is com…
jjaime2 Jul 21, 2025
d68524c
Update constrained task space benchmark to enhance logging, including…
jjaime2 Jul 21, 2025
bbea5c1
Add script to analyze and plot benchmark data
jjaime2 Jul 21, 2025
c740253
Add WIP implementation for a more holistic benchmark that seeks to co…
jjaime2 Jul 22, 2025
7a7059d
Update holistic benchmark, and add holistic benchmark analysis script
jjaime2 Jul 23, 2025
b967cb6
Add granular metrics for planning failure reasons
jjaime2 Jul 23, 2025
2901f14
Add scripts to compute the feasibility manifold, visualize it, and an…
jjaime2 Jul 23, 2025
9f6a1ba
Implement constraint aware start states, and update the analysis scri…
jjaime2 Jul 23, 2025
7fe2c2d
Add constraint adherence score (WIP)
jjaime2 Jul 24, 2025
a0978ba
Add rigid-wrist baseline mode for holistic benchmark
jjaime2 Jul 25, 2025
dbe12de
Revert rigid tool mode, add mode to benchmark all control methods
jjaime2 Jul 26, 2025
97fbd6b
Update benchmark analysis and trajectory visualization script
jjaime2 Jul 26, 2025
ebe9729
Initial commit for end-to-end benchmark
jjaime2 Jul 29, 2025
0000595
Add implementation for S1 primitive
jjaime2 Jul 29, 2025
4b39c5c
Implement S2 planning primitives
jjaime2 Jul 29, 2025
ee4d813
Add logs for generated scene parameters
jjaime2 Jul 29, 2025
8fcb0ff
Solve IK solution to compute AbovePlate configuration
jjaime2 Jul 29, 2025
a778676
Adjust position sampling for food and mouth poses to be within the a …
jjaime2 Jul 30, 2025
a429387
Augment logs for generated scene parameters
jjaime2 Jul 30, 2025
1cdbb3b
Add a bounding cylinder that encompasses the achievable workspace of …
jjaime2 Aug 5, 2025
a68acd8
Extract joints from IK solution corresponding to the Jaco arm plannin…
jjaime2 Aug 5, 2025
77c1c03
Add missing collision links
jjaime2 Aug 5, 2025
ea7125a
Add IK retry logic
jjaime2 Aug 5, 2025
d3be3af
Roll back stages past stage 1, need to focus on getting metrics right…
jjaime2 Aug 5, 2025
64936be
Consolidate logic, serialize/save trajectory, and update the state af…
jjaime2 Aug 5, 2025
55e9eaf
Add visualization script for end-to-end benchmark
jjaime2 Aug 7, 2025
57c4a5a
Serialize and store generated poses in results
jjaime2 Aug 7, 2025
b10a7e3
Update end-to-end visualization script
jjaime2 Aug 7, 2025
0421483
Update end-to-end benchmark to use current Jaco state as start state …
jjaime2 Aug 7, 2025
c1af827
Add visual markers for generated frames
jjaime2 Aug 7, 2025
eaf1f6d
Fix quaternion convention when visualizing generated frames
jjaime2 Aug 7, 2025
0413fe2
Fix logic to generate food frame such that the z-axis is always point…
jjaime2 Aug 7, 2025
7a02e8e
Adjust logic to calculate above food pose so that the the Jaco end-ef…
jjaime2 Aug 9, 2025
43c2061
Add logic to sample pose within a cylindrical shell instead of a sphe…
jjaime2 Aug 9, 2025
f120093
Adjust logic for _calculate_above_plate_pose to determine the directi…
jjaime2 Aug 9, 2025
c5f3e7f
Add classes for semantic acquisition schema
jjaime2 Aug 10, 2025
2a36822
Remove base_z_offset until we can programmatically modify the actual …
jjaime2 Aug 10, 2025
790bcf9
Fix missing parentheses
jjaime2 Aug 10, 2025
5fd176d
Implement skewer logic
jjaime2 Aug 10, 2025
5719655
Add stage for AbovePlate to MoveAbove configurations
jjaime2 Aug 10, 2025
def4076
Remove unused IK solve for planning from Home to AbovePlate
jjaime2 Aug 10, 2025
2ced65d
Add thread locking for MoveIt2 calls to prevent deadlock conditions. …
jjaime2 Aug 12, 2025
b18ef27
Refactor to introduce MotionPlanner class that abstracts the MoveIt2 …
jjaime2 Aug 12, 2025
962e64f
Add MoveIt2 constraints to MotionPlanner class
jjaime2 Aug 12, 2025
be0c747
Abstract high-level trial data from granular stage data
jjaime2 Aug 13, 2025
1b11b76
Add Cartesian planning
jjaime2 Aug 13, 2025
8d9d2e6
Naming convention update
jjaime2 Aug 13, 2025
c34ddb0
Cleanup
jjaime2 Aug 13, 2025
f2d31d0
Add FK and implement plan to in food pose
jjaime2 Aug 13, 2025
db74ec6
Add function to compute leveling configuration for Articutool given t…
jjaime2 Aug 14, 2025
53adfbe
Integrate planning and results for up to Stage 4 (LevelArticutool)
jjaime2 Aug 14, 2025
db8f3a4
Update benchmark to log execution mode (JACO_ONLY, ATOOL_ONLY, SEQUEN…
jjaime2 Aug 14, 2025
161783e
Add logic to handle updated JSON structure and execution modes
jjaime2 Aug 15, 2025
10bf3fb
Adjust cartesian_max_step and cartesian_fraction_threshold
jjaime2 Aug 15, 2025
c934cac
Add cartesian_jump_threshold that limits the maximum distance in join…
jjaime2 Aug 15, 2025
c5b73ed
Add synchronous Articutool trajectory for motion to InFood pose that …
jjaime2 Aug 16, 2025
4ce5fa9
Remove pre-rotation logic
jjaime2 Aug 16, 2025
a7c5a47
Add unit test for analytical Articutool IK solver
jjaime2 Aug 16, 2025
358c177
Fix error in updating Pinocchio robot state within the Pinocchio mode…
jjaime2 Aug 16, 2025
6ba8f5c
Add PinoccioModel class to make querying Pinocchio easier
jjaime2 Aug 16, 2025
fb821da
Update .gitignore
jjaime2 Aug 17, 2025
dd2bdea
Add planning stage for motion to Resting pose
jjaime2 Aug 19, 2025
494acb8
Add tool roll angle when defining InFood pose
jjaime2 Aug 19, 2025
c1cce56
Add logic to programmatically generate Resting pose, and fix issue wh…
jjaime2 Aug 20, 2025
21a8e92
Fix issue where JointTrajectoryPoint is not cast to list
jjaime2 Aug 20, 2025
5c8ec49
Ensure IK solution continuity when generating level-to-gravity Articu…
jjaime2 Aug 20, 2025
46913bf
Enhance benchmark with granular metric tracking instrumentation
jjaime2 Aug 20, 2025
60e51c8
Add script to analyze benchmark results and produce aggregate statistics
jjaime2 Aug 20, 2025
c5aba4b
Comment out verbose scene log
jjaime2 Aug 20, 2025
2d76149
Major refactor to abstract scene generation into a dedicated class
jjaime2 Aug 20, 2025
c5febbd
Update analysis script to provide a quantitative overview of the perf…
jjaime2 Aug 20, 2025
e682046
Update visualization script to take a trial-centric approach
jjaime2 Aug 20, 2025
18aaf55
Add label during trial selection indicating the last successful stage
jjaime2 Aug 20, 2025
9fd2c9d
Modify visualization script to show scene even if no successful traje…
jjaime2 Aug 20, 2025
e9091a0
Relax scene generation parameters to analyze a larger subset of the w…
jjaime2 Aug 20, 2025
37b5616
Tighten spherical parameters for generating food pose
jjaime2 Aug 20, 2025
c8046d5
Reduce yaw variability for AbovePlate pose
jjaime2 Aug 20, 2025
33d2d19
Update analysis script to group statistics based on the specific stag…
jjaime2 Aug 20, 2025
b423c7e
Adjust resting parameters
jjaime2 Aug 20, 2025
4864274
Add anti-roll constraint for motion to AboveFood
jjaime2 Aug 20, 2025
de153ee
Updates the benchmark to save results to a .jsonl file after each tri…
jjaime2 Aug 20, 2025
6ff01ec
Re-integrate sampling poses from a spherical shell
jjaime2 Aug 20, 2025
7886c71
Update visualization script to use JSON lines
jjaime2 Aug 21, 2025
7b29f1d
Abstract pose sampling to first sampling positions in a geometric pri…
jjaime2 Aug 21, 2025
fefeb40
Add metrics for pose distance, angular offsets, and logging the targe…
jjaime2 Aug 21, 2025
7ee7580
Add unmeasured data to results
jjaime2 Aug 21, 2025
7ab6d18
Sample food and mouth frame from spherical shell
jjaime2 Aug 22, 2025
27e8cf0
Temporarily disable Articutool bounding cylinder used for conservativ…
jjaime2 Aug 22, 2025
74539ac
Add position constraint to motion planning interface
jjaime2 Aug 22, 2025
8c048c7
Loosen orientation constraint for AbovePlate pose
jjaime2 Aug 22, 2025
fd97986
Use position constraint for Resting stage
jjaime2 Aug 22, 2025
1459e57
Major refactor of analysis script to focus on generating granular vis…
jjaime2 Aug 22, 2025
9519c48
Use a relevance map to only show frames relevant to a particular stag…
jjaime2 Aug 22, 2025
6bf7443
Add min/max height parameters to spherical sampling
jjaime2 Aug 22, 2025
7ed0549
Add min/max height spherical sampling parameters for food, mouth, and…
jjaime2 Aug 22, 2025
fe8adc4
Set up the initial default state of the plot correctly from the start…
jjaime2 Aug 22, 2025
7dd71f4
Remove unused function
jjaime2 Aug 22, 2025
a2cfcd5
Add stage to re-orient wrist to a kinematically advantageous orientat…
jjaime2 Aug 22, 2025
6f0f01f
Add retry logic for HomeToAbovePlate motion to improve robustness to …
jjaime2 Aug 23, 2025
be3e934
Add method to Pinocchio wrapper to compute the Jacobian for a frame a…
jjaime2 Aug 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,35 @@ trees/debug.xml
ada_feeding_perception/test/food_img/
ada_feeding_perception/test/output/
ada_feeding_action_select/data

# Debug/scratch tree
trees/debug.xml

# ===============================================================
# Python Artifacts (Consolidated and Added)
# ===============================================================
__pycache__/
*.pyc
.ada_venv/
venv/
.venv/
env/

# ===============================================================
# Project-Specific Data, Plots, and Benchmark Outputs (Added)
# ===============================================================
# Ignore generated data, plots, and saved trajectories
ada_feeding/data/

# Ignore all benchmark and analysis output directories
ada_feeding/scripts/benchmark_analysis_plots/
ada_feeding/scripts/e2e_benchmark_output/
ada_feeding/scripts/holistic_benchmark_output/
ada_feeding/scripts/manifold_data/
ada_feeding/scripts/visualization_output/

# Ignore specific generated files in the scripts directory
ada_feeding/scripts/camera_poses.json

# Ignore screenshots directory at the root
screenshots/
3 changes: 3 additions & 0 deletions ada_feeding/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ install(PROGRAMS
scripts/dummy_ft_sensor.py
scripts/joint_state_latency.py
scripts/planner_benchmark.py
scripts/planner_benchmark_analysis.py
scripts/orientation_constrained_planner_benchmark.py
scripts/visualize_trajectory.py
scripts/robot_state_service.py
scripts/save_image.py
DESTINATION lib/${PROJECT_NAME}
Expand Down
4 changes: 4 additions & 0 deletions ada_feeding/ada_feeding/behaviors/acquisition/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
ComputeActionConstraints,
ComputeActionTwist,
)
from .rotate_local_approach_poses import (
RotateLocalApproachPoses,
)
from .conditionally_rotate_food_frame import ConditionallyRotateFoodFrame
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"""
This module defines behaviors that take an AcquisitionSchema.msg object
(or return from AcquisitionSelect.srv) and computes the outputs
needed to send MoveIt2Plan calls.
needed to send MoveIt2Plan calls and execute primitive actions.
"""

# Standard imports
from copy import deepcopy
from typing import Union, Optional
from typing import Union, Optional, List

# Third-party imports
from geometry_msgs.msg import (
Expand Down Expand Up @@ -45,7 +45,7 @@ class ComputeActionConstraints(BlackboardBehavior):
"""
Checks AcquisitionSelect response, implements stochastic
policy choice, and then decomposes into individual
BlackboardKey objects for MoveIt2 Behaviors.
BlackboardKey objects for MoveIt2 Behaviors and Primitive Actions.

Also sets static TF from food -> approach frame
"""
Expand Down Expand Up @@ -93,6 +93,11 @@ def blackboard_outputs(
ext_thresh: Optional[BlackboardKey], # SetParameters.Request
action: Optional[BlackboardKey], # AcquisitionSchema.msg
action_index: Optional[BlackboardKey], # int
post_move_into_primitive_name: Optional[BlackboardKey],
post_move_into_primitive_params: Optional[BlackboardKey],
post_acquisition_primitive_name: Optional[BlackboardKey],
post_acquisition_primitive_params: Optional[BlackboardKey],
should_align_to_base: Optional[BlackboardKey],
) -> None:
"""
Blackboard Outputs
Expand All @@ -106,6 +111,10 @@ def blackboard_outputs(
grasp_thresh: SetParameters request to set thresholds in grasp
ext_thresh: SetParameters request to set thresholds for extraction
action: AcquisitionSchema object to use in later computations
post_move_into_primitive_name: The name of the primitive to run after MoveInto.
post_move_into_primitive_params: The parameters for that primitive.
post_acquisition_primitive_name: The name of the primitive to run after acquisition.
post_acquisition_primitive_params: The parameters for that primitive.
"""
# pylint: disable=unused-argument, duplicate-code
# Arguments are handled generically in base class.
Expand Down Expand Up @@ -206,7 +215,41 @@ def update(self) -> py_trees.common.Status:
create_ft_thresh_request(action.ext_force, action.ext_torque),
)

### Final write to Blackboard
# Post-Move-Into Primitive
# post_move_into_name = (
# action.post_move_into_primitive_name or "NONE"
# ) # Default to NONE
post_move_into_name = action.post_move_into_primitive_name
post_move_into_params = list(action.post_move_into_primitive_params)
self.blackboard_set("post_move_into_primitive_name", post_move_into_name)
self.blackboard_set(
"post_move_into_primitive_params", post_move_into_params
)
self.logger.info(
f"[{self.name}] Set Post-MoveInto Primitive to: '{post_move_into_name}' with params: {post_move_into_params}"
)

# Post-Acquisition Primitive
# post_acquisition_name = (
# action.post_acquisition_primitive_name or "NONE"
# ) # Default to NONE
post_acquisition_name = action.post_acquisition_primitive_name
post_acquisition_params = list(action.post_acquisition_primitive_params)
self.blackboard_set(
"post_acquisition_primitive_name", post_acquisition_name
)
self.blackboard_set(
"post_acquisition_primitive_params", post_acquisition_params
)
self.logger.info(
f"[{self.name}] Set Post-Acquisition Primitive to: '{post_acquisition_name}' with params: {post_acquisition_params}"
)

self.blackboard_set("should_align_to_base", action.align_to_robot_base)
self.logger.info(
f"[{self.name}] Set 'should_align_to_base' flag to: {action.align_to_robot_base}"
)

self.blackboard_set("action", action)
self.blackboard_set("action_index", index)
return py_trees.common.Status.SUCCESS
Expand All @@ -232,6 +275,7 @@ def blackboard_inputs(
action: Union[BlackboardKey, AcquisitionSchema],
is_grasp: Union[BlackboardKey, bool] = True,
approach_frame_id: Union[BlackboardKey, str] = "approach",
group_name: Union[BlackboardKey, str] = "jaco_arm_with_articutool",
) -> None:
"""
Blackboard Inputs
Expand All @@ -241,6 +285,7 @@ def blackboard_inputs(
action: AcquisitionSchema msg object
is_grasp: if true, use the grasp action elements, else use extraction
approach_frame_id: approach frame defined in AcquisitionSchema.msg
group_name: The name of the MoveIt2 planning group
"""
# pylint: disable=unused-argument, duplicate-code
# Arguments are handled generically in base class.
Expand Down Expand Up @@ -279,6 +324,9 @@ def setup(self, **kwargs):
# Get Node from Kwargs
self.node = kwargs["node"]

# Get group name from blackboard
self.group_name = self.blackboard_get("group_name")

# Get TF Listener from blackboard
# For transform approach -> end_effector_frame
self.tf_buffer, _, self.tf_lock = get_tf_object(self.blackboard, self.node)
Expand All @@ -288,6 +336,7 @@ def setup(self, **kwargs):
self.moveit2, self.moveit2_lock = get_moveit2_object(
self.blackboard,
self.node,
self.group_name,
)

@override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,23 @@

"""
This module defines the ComputeFoodFrame behavior, which computes the
food frame from the Mask provided from a perception algorithm.
food frame from the Mask provided from a perception algorithm, with an
option to align it to the robot's base.
"""
# Standard imports
import math
from typing import Optional, Tuple, Union

# Third-party imports
import cv2 as cv
from geometry_msgs.msg import PointStamped, TransformStamped, Vector3Stamped
from geometry_msgs.msg import (
PointStamped,
TransformStamped,
Vector3Stamped,
Pose,
Quaternion,
Vector3,
)
import numpy as np
import numpy.typing as npt
from overrides import override
Expand All @@ -20,6 +29,8 @@
import rclpy
from sensor_msgs.msg import CameraInfo
import tf2_ros
from scipy.spatial.transform import Rotation as R
import ros2_numpy

# Local imports
from ada_feeding_msgs.msg import Mask
Expand All @@ -36,8 +47,10 @@

class ComputeFoodFrame(BlackboardBehavior):
"""
Computes the food reference frame.
See definition in AcquisitionSchema.msg
Computes the food reference frame from a perception mask.
Optionally rotates this frame around its Z-axis to align its
local X-axis with the vector from the robot base to the food origin.
See definition in AcquisitionSchema.msg.
"""

# pylint: disable=arguments-differ
Expand All @@ -48,6 +61,7 @@ class ComputeFoodFrame(BlackboardBehavior):
# pylint: disable=too-many-arguments
# These are effectively config definitions
# They require a lot of arguments.
EPSILON = 1e-6

def blackboard_inputs(
self,
Expand All @@ -56,6 +70,8 @@ def blackboard_inputs(
timestamp: Union[BlackboardKey, rclpy.time.Time] = rclpy.time.Time(),
food_frame_id: Union[BlackboardKey, str] = "food",
world_frame: Union[BlackboardKey, str] = "world",
robot_base_frame_id: Union[BlackboardKey, str] = "j2n6s200_link_base",
align_to_robot_base: Union[BlackboardKey, bool] = True,
flip_food_frame: Union[BlackboardKey, bool] = False,
) -> None:
"""
Expand All @@ -70,6 +86,9 @@ def blackboard_inputs(
food_frame_id (string): If len>0, TF frame to publish static transform
(relative to world_frame)
world_frame (string): ID of the TF frame to represent the food frame in
robot_base_frame_id (string): ID of the robot's base frame for alignment.
align_to_robot_base (bool): If true, rotates the computed food_frame
around its Z-axis to align with the robot.
flip_food_frame (bool): whether to rotate the food frame 180 about Z
"""
# pylint: disable=unused-argument, duplicate-code
Expand Down Expand Up @@ -217,6 +236,10 @@ def get_mask_center(

return (mask.roi.x_offset + c_x, mask.roi.y_offset + c_y, median_depth)

def _normalize_angle(self, angle: float) -> float:
"""Normalize an angle to [-pi, pi]."""
return (angle + math.pi) % (2 * math.pi) - math.pi

@override
def update(self) -> py_trees.common.Status:
# Docstring copied from @override
Expand Down Expand Up @@ -327,15 +350,71 @@ def update(self) -> py_trees.common.Status:
# Project to world x-y plane
x_pos.vector.z = 0.0

world_food_initial_quat_xyzw = quat_between_vectors(
Vector3(x=1.0), x_pos.vector
)

R_world_food_initial = R.from_quat(
[
world_food_initial_quat_xyzw.x,
world_food_initial_quat_xyzw.y,
world_food_initial_quat_xyzw.z,
world_food_initial_quat_xyzw.w,
]
)

# Conditionally rotate the food frame to align with the robot base
R_correction_z = R.identity() # Start with no correction
if self.blackboard_get("align_to_robot_base"):
P_food_in_rb = ros2_numpy.numpify(center.point)
L_xy_rb_numpy = np.array([P_food_in_rb[0], P_food_in_rb[1]])

if np.linalg.norm(L_xy_rb_numpy) < self.EPSILON:
self.logger.info(
f"[{self.name}] Food origin too close to robot base. No alignment rotation applied."
)
else:
desired_global_approach_yaw_rb = math.atan2(
L_xy_rb_numpy[1], L_xy_rb_numpy[0]
)

X_axis_in_food_frame = np.array([1.0, 0.0, 0.0])
X_axis_in_rb_frame = R_world_food_initial.apply(X_axis_in_food_frame)
X_axis_xy_in_rb_frame = np.array(
[X_axis_in_rb_frame[0], X_axis_in_rb_frame[1]]
)

if np.linalg.norm(X_axis_xy_in_rb_frame) < self.EPSILON:
self.logger.warn(
f"[{self.name}] Food frame X-axis has no projection in robot base XY plane. Cannot align."
)
else:
current_food_x_yaw_rb = math.atan2(
X_axis_xy_in_rb_frame[1], X_axis_xy_in_rb_frame[0]
)
delta_psi_food_z = self._normalize_angle(
desired_global_approach_yaw_rb - current_food_x_yaw_rb
)

self.logger.info(
f"[{self.name}] Applying alignment rotation of {math.degrees(delta_psi_food_z):.1f} deg to food frame."
)
R_correction_z = R.from_euler("z", delta_psi_food_z)

# --- Final Transform Calculation ---
R_world_food_final = R_world_food_initial * R_correction_z

# Convert to TransformStamped
world_to_food_transform.transform.translation.x = center.point.x
world_to_food_transform.transform.translation.y = center.point.y
world_to_food_transform.transform.translation.z = center.point.z

x_unit = Vector3Stamped()
x_unit.vector.x = 1.0
world_to_food_transform.transform.rotation = quat_between_vectors(
x_unit.vector, x_pos.vector
final_quat_xyzw = R_world_food_final.as_quat()
world_to_food_transform.transform.rotation = Quaternion(
x=final_quat_xyzw[0],
y=final_quat_xyzw[1],
z=final_quat_xyzw[2],
w=final_quat_xyzw[3],
)

# # If you need to send a fixed food frame to the robot arm, e.g., to
Expand Down
Loading
Loading