Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Click-to-Pregrasp #52

Merged
merged 37 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
80e077c
Add the scaffolding for the web app to invoke MoveToPregrasp action
hello-amal May 28, 2024
bcb9fe7
Got the action server to receive and deproject the point
hello-amal May 29, 2024
c9a7d9a
[WIP] Computing the Jacobian for arm lift works
hello-amal May 30, 2024
9a8abb5
Arm motion via inverse jacobian control works
hello-amal May 30, 2024
d47273f
Base rotation works
hello-amal May 31, 2024
be2e560
Refactored Inverse JAcobian Controller, still a few bugs and todos
hello-amal May 31, 2024
9587a7d
MVP functionality works
hello-amal Jun 4, 2024
a0cec4a
Increased camera resolution, offset goal from object
hello-amal Jun 5, 2024
d32cd06
Got pinnochio IK working
hello-amal Jun 6, 2024
825e6b4
Functionality works, base rotation is slightly off
hello-amal Jun 7, 2024
308b12c
[WIP] Consolidate all realsense subs into one node
hello-amal Jun 7, 2024
99a7932
Added old stretch ik control
hello-amal Jun 7, 2024
3957e00
[WIP] merged all nodes into one
hello-amal Jun 8, 2024
17c7b0e
Undid merged node, got it working with one node by replacing co-routi…
hello-amal Jun 8, 2024
a2b65f1
Cleanup before draft PR
hello-amal Jun 10, 2024
956614c
Selected UX visuals for the feature
hello-amal Jun 11, 2024
02d2b82
Fully integrated into web app for MVP
hello-amal Jun 11, 2024
1482093
Added head pan to match base rotation
hello-amal Jun 12, 2024
bd24990
Update action and comments
hello-amal Jun 12, 2024
e47fad6
Switched to compressed images, added debugging infra for the rotation…
hello-amal Jun 12, 2024
d93d164
Moved helpers into their own package
hello-amal Jun 13, 2024
8eb12a3
WIP: Improved upon the slight degree offset for base rotation
hello-amal Jun 14, 2024
fd39698
Fix the few-degree offset in click-to-pregrasp
hello-amal Jun 14, 2024
b127f8e
Allow for closer than 10cm grasps
hello-amal Jun 14, 2024
6bbac8d
Only enable click-to-pregrasp if there is a dex wrist with a gripper
hello-amal Jun 14, 2024
2893860
WIP: Programatically modify robot model with pinocchio
hello-amal Jun 15, 2024
f8ff36e
Undid programatic URDF investigation
hello-amal Jun 15, 2024
dd75c72
Stop reconnecting via stats report
hello-amal Jun 18, 2024
3701c09
Merge branch 'master' into amaln/click_to_pregrasp
hello-amal Jun 19, 2024
63958f4
Add requirements and prepare_specialized_urdf.py
hello-amal Jun 20, 2024
bcf13f0
Separate state logic into a helper
hello-amal Jun 20, 2024
85dfef5
Merge branch 'master' into amaln/click_to_pregrasp
hello-amal Jun 20, 2024
14d0247
Clean up code
hello-amal Jun 21, 2024
e27506a
Merge branch 'master' into amaln/click_to_pregrasp
hello-amal Jun 21, 2024
89bc7c7
Copied new pinocchio_ik_solver in
hello-amal Jun 21, 2024
c2ac1c5
Update README and requirements
hello-amal Jun 21, 2024
a643477
Remove resolved TODO comments
hello-amal Jun 28, 2024
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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ mkcert*
dist/*

outcomes/*

# Compiled Python
*/__pycache__

# Specialized URDFs
urdf/*.urdf
19 changes: 19 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,27 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
endif()

find_package(ament_cmake REQUIRED)
find_package(ament_cmake_python REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(rosbridge_server REQUIRED)
find_package(rosidl_default_generators REQUIRED)
# find_package(tf2_web_republisher REQUIRED)

##############################
## Generate Custom Messages ##
##############################
rosidl_generate_interfaces(${PROJECT_NAME}
"action/MoveToPregrasp.action"
DEPENDENCIES geometry_msgs
)


#############
## Install ##
#############

ament_python_install_package(${PROJECT_NAME}_helpers)

# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html

Expand All @@ -24,6 +38,7 @@ find_package(rosbridge_server REQUIRED)
install(PROGRAMS
nodes/compressed_image_visualizer.py
nodes/configure_video_streams.py
nodes/move_to_pregrasp.py
nodes/navigation_camera.py
DESTINATION lib/${PROJECT_NAME}
)
Expand All @@ -40,6 +55,10 @@ install(DIRECTORY nodes
DESTINATION share/${PROJECT_NAME}
)

install(DIRECTORY urdf
DESTINATION share/${PROJECT_NAME}
)

install(DIRECTORY config
DESTINATION share/${PROJECT_NAME}
)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

This interface enables a user to remotely teleoperate a Stretch robot through a web browser. This website can be set up to teleoperate the robot remotely from anywhere in the world with an internet connection, or simply eyes-off teleop from the next room on a local network. The codebase is built on ROS2, WebRTC, Nav2, and TypeScript.

# Setup
# Setup & Installation

The interface is compatible with the Stretch RE1, RE2 and SE3. It currently only supports Ubuntu 22.04 and ROS2 Humble. Upgrade your operating system if necessary ([instructions](<>)) and create a the Stretch ROS2 Humble workspace ([instructions](<>)). This will install all package dependencies and install the web teleop interface.
The interface is compatible with the Stretch RE1, RE2 and SE3. It currently only supports Ubuntu 22.04 and ROS2 Humble. Upgrade your operating system if necessary ([instructions](https://docs.hello-robot.com/0.3/installation/robot_install/)) and create/update the Stretch ROS2 Humble workspace ([instructions](https://docs.hello-robot.com/0.3/installation/ros_workspace/)). This will install all package dependencies and install the web teleop interface.

## Installing Beta Teleop Cameras

Expand Down
31 changes: 31 additions & 0 deletions action/MoveToPregrasp.action
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# MoveToPregrasp takes in the scaled (u,v) coordinates of a click on the Realsense camera,
# as well as some configuration such as the direction of the pregrasp. It then moves
# the robot to the pregrasp configuration, giving feedback on the way.

# These should be in the range [0.0, 1.0]
float64 scaled_u
float64 scaled_v

uint8 PREGRASP_DIRECTION_AUTO=0
uint8 PREGRASP_DIRECTION_HORIZONTAL=1
uint8 PREGRASP_DIRECTION_VERTICAL=2

uint8 pregrasp_direction

---
# Result

uint8 STATUS_SUCCESS=0
uint8 STATUS_FAILURE=1
uint8 STATUS_CANCELLED = 2
uint8 STATUS_TIMEOUT = 3
uint8 STATUS_GOAL_NOT_REACHABLE = 4
uint8 STATUS_DEPROJECTION_FAILURE = 5
uint8 STATUS_STRETCH_DRIVER_FAILURE = 6

uint8 status
---
# Feedback
float32 initial_distance_m
float32 remaining_distance_m
builtin_interfaces/Duration elapsed_time
7 changes: 6 additions & 1 deletion launch/gripper_camera.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ def generate_launch_description():
{"camera_name": "gripper_camera"},
{"io_method": "mmap"},
],
remappings=[("/image_raw", "/gripper_camera/image_raw")],
remappings=[
("/image_raw", "/gripper_camera/image_raw")
# usb_cam does not publish compressed images:
# https://github.com/ros-drivers/usb_cam/blob/52dd75fb78ae608a2c40eea60f6e8eac673b91e8/src/ros2/usb_cam_node.cpp#L50
# ("/image_raw/compressed", "/gripper_camera/image_raw/compressed")
],
),
# You can add more nodes or configurations here if needed.
]
Expand Down
17 changes: 12 additions & 5 deletions launch/multi_camera.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
get_package_share_directory("stretch_core"), "config", "HighAccuracyPreset.json"
)

D435_RESOLUTION = "424x240x15"
D405_RESOLUTION = "480x270x15"

configurable_parameters = [
{"name": "camera_namespace1", "default": "", "description": "namespace for camera"},
{"name": "camera_name1", "default": "camera", "description": "camera unique name"},
Expand All @@ -23,18 +26,18 @@
},
{
"name": "depth_module.depth_profile1",
"default": "424x240x15",
"default": D435_RESOLUTION,
"description": "depth module profile",
},
{
"name": "depth_module.infra_profile1",
"default": "424x240x15",
"default": D435_RESOLUTION,
"description": "depth module infrared profile",
},
{"name": "enable_depth1", "default": "true", "description": "enable depth stream"},
{
"name": "rgb_camera.color_profile1",
"default": "424x240x15",
"default": D435_RESOLUTION,
"description": "color image width",
},
{"name": "enable_color1", "default": "true", "description": "enable color stream"},
Expand Down Expand Up @@ -87,7 +90,7 @@
},
{
"name": "depth_module.depth_profile2",
"default": "480x270x15",
"default": D405_RESOLUTION,
"description": "depth module profile",
},
{
Expand All @@ -98,7 +101,7 @@
{"name": "enable_depth2", "default": "true", "description": "enable depth stream"},
{
"name": "depth_module.color_profile2",
"default": "480x270x15",
"default": D405_RESOLUTION,
"description": "color image width",
},
{"name": "enable_color2", "default": "true", "description": "enable color stream"},
Expand Down Expand Up @@ -164,6 +167,10 @@ def generate_launch_description():
src="/gripper_camera/color/image_rect_raw",
dst="/gripper_camera/image_raw",
),
SetRemap(
src="/gripper_camera/color/image_rect_raw/compressed",
dst="/gripper_camera/image_raw/compressed",
),
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
[
Expand Down
7 changes: 6 additions & 1 deletion launch/navigation_camera.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ def generate_launch_description():
{"camera_name": "navigation_camera"},
{"io_method": "mmap"},
],
remappings=[("/image_raw", "/navigation_camera/image_raw")],
remappings=[
("/image_raw", "/navigation_camera/image_raw"),
# usb_cam does not publish compressed images:
# https://github.com/ros-drivers/usb_cam/blob/52dd75fb78ae608a2c40eea60f6e8eac673b91e8/src/ros2/usb_cam_node.cpp#L50
# ("/image_raw/compressed", "/navigation_camera/image_raw/compressed")
],
),
# You can add more nodes or configurations here if needed.
]
Expand Down
11 changes: 11 additions & 0 deletions launch/web_interface.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,4 +505,15 @@ def generate_launch_description():
# shell=True,
# )
# )

# Move To Pre-grasp Action Server
move_to_pregrasp_node = Node(
package="stretch_web_teleop",
executable="move_to_pregrasp.py",
output="screen",
arguments=[LaunchConfiguration("params")],
parameters=[],
)
ld.add_action(move_to_pregrasp_node)

return ld
Loading