Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
8793f9d
FSM DSL GEN
ashleshp Oct 8, 2025
bd74bc8
Documentation
ashleshp Oct 9, 2025
f832bc1
Docs FSM updates
ashleshp Oct 9, 2025
f20a8a8
Revert "Docs FSM updates"
ashleshp Oct 9, 2025
6adafe0
Docs fsm states updates
ashleshp Oct 9, 2025
03dce0c
Event driven flow
ashleshp Oct 25, 2025
d673d58
Delete build directory
ashleshp Oct 25, 2025
e4db0c5
Delete install directory
ashleshp Oct 25, 2025
e4baa92
Delete log directory
ashleshp Oct 25, 2025
62d61b0
pick place fsm using py
ashleshp Dec 4, 2025
a9d5f76
removed move_to_place state
ashleshp Dec 7, 2025
ab7a553
Temporary fallback to avoid TF error
ashleshp Dec 10, 2025
8c4ad43
fix fsm now uses result status code and result message
bhunecke Dec 12, 2025
18b5e9e
execute via planner support
ashleshp Dec 15, 2025
7153d82
fsm diagram
ashleshp Dec 15, 2025
ea283ea
Readme update
ashleshp Dec 15, 2025
44eee1b
refactor: replace hardcoded offsets with pose transformation
bhunecke Dec 16, 2025
b2c15db
remove mock servers only and update home pose
bhunecke Dec 16, 2025
139c3d3
Delete images/FSM_pick_and_place.png
ashleshp Dec 16, 2025
1f9900a
Delete images/readme.md
ashleshp Dec 16, 2025
44cb98f
Delete include/pick_place_fsm.hpp
ashleshp Dec 16, 2025
09784d6
Revise how to run Eddie interface and FSM
ashleshp Dec 16, 2025
1860574
Delete include/pick_place.fsm
ashleshp Dec 17, 2025
b739b30
Add reference for detailed robot setup steps
ashleshp Dec 17, 2025
ab90b53
added error handling case #1 - object slipping during pick and place
jetcanine Dec 16, 2025
3231555
final changes
jetcanine Dec 17, 2025
33bbf0a
build file fix
ashleshp Dec 17, 2025
c7d1d6c
merged with latest pick_place
ashleshp Dec 17, 2025
72025d0
action server fix
ashleshp Dec 17, 2025
87e16b6
Add object slip detection section to README
jetcanine Dec 17, 2025
5fe7191
Add ommand to README
jetcanine Dec 17, 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
41 changes: 20 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
cmake_minimum_required(VERSION 3.8)
project(pick_place_fsm)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_action REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(eddie_ros REQUIRED) # ← only for .action headers
find_package(rosidl_default_generators REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
"srv/CaptureReference.srv"
)

install(PROGRAMS
src/pick_place.py
DESTINATION lib/${PROJECT_NAME}
RENAME pick_place
)

# ---------- CLIENT NODE ----------
add_executable(pick_place_fsm_mock
src/pick_place_fsm_mock.cpp)
ament_target_dependencies(pick_place_fsm_mock
rclcpp rclcpp_action geometry_msgs eddie_ros)
install(TARGETS pick_place_fsm_mock
DESTINATION lib/${PROJECT_NAME})
install(PROGRAMS
include/fsm_pick_place.py
src/error_handling.py
DESTINATION lib/${PROJECT_NAME}
)

# ---------- MOCK SERVER NODE ----------
add_executable(mock_servers_only
src/mock_servers_only.cpp)
ament_target_dependencies(mock_servers_only
rclcpp rclcpp_action eddie_ros) # geometry_msgs pulled in by eddie_ros
install(TARGETS mock_servers_only
DESTINATION lib/${PROJECT_NAME})
install(
DIRECTORY include/
DESTINATION include
)

ament_package()
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Pick and Place FSM (Python)

This package contains a Python pick-and-place FSM client that talks to the arm/gripper action servers and delegates arm motion to the spline planner.

## FSM Overview

![FSM diagram](images/fsm_diagram.png)

States (see `include/pick_place_py.fsm`):
- `S_IDLE` → waits for start
- `S_POSE_DETECTION` → listens for `/object_pose`
- `S_MOVE_ARM` → send arm motion (via spline planner action)
- `S_CLOSE_GRIPPER` → close on object
- `S_OPEN_GRIPPER` → release object
- `S_FINISHED` → success path
- `S_MOVE_ARM_HOME` → return home
- `S_EXIT` → terminal state

Key events: `E_START`, `E_PERCEPTION_POSE`, `E_PICK_MOVE_DONE`, `E_PLACE_MOVE_DONE`, `E_GRIPPER_CLOSE_DONE_OK`, `E_OPEN_DONE_OK`, `E_HOME_DONE_OK`, `E_ARM_MOVE_DONE_FAIL`, `E_HOME_DONE_FAIL`, `E_PERCEPTION_FAIL`, `E_GO_HOME`.

## Runtime Topics & Actions
- Subscribes: `/object_pose` (`geometry_msgs/PoseStamped`)
- Actions (real or mock):
- `right_arm/arm_control` (`eddie_ros/ArmControl`)
- `right_arm/gripper_control` (`eddie_ros/GripperControl`)
- Planner: `spline_plan` (`cartesian_planner/PlanSpline`) for generating/executing waypoints

## Object Slip Detection
- Reference capture
After the gripper successfully finishes a close action, the pick-and-place FSM calls the service
/gripper_slip/capture_reference.
At that moment, the slip detector latches the current measured gripper opening derived from the gripper joint encoder in /joint_states.
The detector converts the joint position of eddie_right_arm_robotiq_85_left_knuckle_joint
into a percentage opening (0–100 %) and stores this single value as the reference position.

- Motion check
During subsequent motion, the slip detector continuously listens to /joint_states and updates the current measured gripper opening in percent.
The detector compares each incoming measurement against the stored reference.
If the relative drift between the current value and the reference exceeds a configurable threshold (drift_thresh_percent), the node flags a slip event and publishes True on /gripper_slip

drift : |current − reference| / reference

## Quick Start
```
colcon build
source install/setup.bash
# Eddie interface depending on simulation or real hardware

ros2 run cartesian_planner spline_planner # planner
ros2 run pick_place_fsm pick_place # FSM client
ros2 run pick_place_fsm error_handling.py # object slip detection
```
### Refer [Detail steps](how_to_run.md) on how to run with complete robot setup

## Regenerating FSM Code(.fsm)
Requires `coord-dsl`:
```
textx generate include/pick_place_py.fsm --target fsm_py -o include/fsm_pick_place.py
```
1 change: 0 additions & 1 deletion build/.built_by

This file was deleted.

Empty file removed build/COLCON_IGNORE
Empty file.
Empty file.
Empty file removed build/pick_place_fsm/AMENT_IGNORE
Empty file.
Loading