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

Generate IK URDF on-the-fly #108

Merged
merged 16 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ install(DIRECTORY nodes
DESTINATION share/${PROJECT_NAME}
)

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

install(DIRECTORY config
DESTINATION share/${PROJECT_NAME}
)
Expand Down
17 changes: 0 additions & 17 deletions launch/web_interface.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,23 +196,6 @@ def generate_launch_description():
stretch_has_nav_head_cam,
)

# If the stretch tool has the configuration(s) that require the specialized URDFs
# (e.g., move-to-pregrasp, enabled with the dex wrist, requires the specialized URDFs),
# check if the specialized URDFs exist and raise an exception if they don't.
if stretch_tool == "eoa_wrist_dw3_tool_sg3":
specialized_urdf_path = os.path.join(
teleop_interface_package, "urdf", "stretch_base_rotation_ik.urdf"
)
if not os.path.exists(specialized_urdf_path):
raise FileNotFoundError(
"Could not find the specialized URDF, which is required for move-to-pregrasp, "
f"at {specialized_urdf_path}. Run the following:\n"
" 1. `colcon_cd stretch_web_teleop`\n"
" 2. `python3 prepare_specialized_urdf.py`\n"
" 3. `cd ~/ament_ws`\n"
" 4. `colcon build`"
)

# Declare launch arguments
params_file = DeclareLaunchArgument(
"params",
Expand Down
14 changes: 6 additions & 8 deletions nodes/move_to_pregrasp.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/usr/bin/env python3

# Standard Imports
import os
import sys
import threading
import traceback
from typing import Dict, Generator, List, Optional, Tuple

# Third-Party Imports
import numpy as np
import numpy.typing as npt
import rclpy

# Third-Party Imports
import stretch_urdf.urdf_utils as uu
import tf2_ros
import yaml
from ament_index_python import get_package_share_directory
from cv_bridge import CvBridge
from geometry_msgs.msg import Point, Quaternion, Transform, TransformStamped, Vector3
from rclpy.action import ActionServer, CancelResponse, GoalResponse
Expand Down Expand Up @@ -100,14 +100,12 @@ def __init__(
self.wrist_offset: Optional[Tuple[float, float]] = None

# Create the inverse jacobian controller to execute motions
urdf_abs_path = os.path.join(
get_package_share_directory("stretch_web_teleop"),
"urdf/stretch_base_rotation_ik.urdf",
)
urdf_fpaths = uu.generate_ik_urdfs("stretch_web_teleop", rigid_wrist_urdf=False)
urdf_fpath = urdf_fpaths[0]
self.controller = StretchIKControl(
self,
tf_buffer=self.tf_buffer,
urdf_path=urdf_abs_path,
urdf_path=urdf_fpath,
static_transform_broadcaster=self.static_transform_broadcaster,
)

Expand Down
252 changes: 0 additions & 252 deletions prepare_specialized_urdf.py

This file was deleted.

1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
gTTS
hello-robot-stretch-urdf>=0.1.0
loguru
pin
PyAudio==0.2.14
Expand Down
Empty file removed urdf/.placeholder
Empty file.