Skip to content

Commit

Permalink
ベンド針のモデルをeuslispで作成
Browse files Browse the repository at this point in the history
  • Loading branch information
Michi-Tsubaki committed Feb 17, 2025
1 parent 99ce4b8 commit 40f423b
Show file tree
Hide file tree
Showing 8 changed files with 1,011 additions and 0 deletions.
1 change: 1 addition & 0 deletions jsk_2024_10_semi/pr2_tubes/.catkin_workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This file currently only serves to mark the location of a catkin workspace for tool integration
208 changes: 208 additions & 0 deletions jsk_2024_10_semi/pr2_tubes/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
cmake_minimum_required(VERSION 3.0.2)
project(pr2_surgery)

## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
jsk_recognition_msgs
roscpp
roseus
rospy
std_msgs
)

## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)


## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()

################################################
## Declare ROS messages, services and actions ##
################################################

## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
## * add a build_depend tag for "message_generation"
## * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET
## * If MSG_DEP_SET isn't empty the following dependency has been pulled in
## but can be declared for certainty nonetheless:
## * add a exec_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
## * add "message_generation" and every package in MSG_DEP_SET to
## find_package(catkin REQUIRED COMPONENTS ...)
## * add "message_runtime" and every package in MSG_DEP_SET to
## catkin_package(CATKIN_DEPENDS ...)
## * uncomment the add_*_files sections below as needed
## and list every .msg/.srv/.action file to be processed
## * uncomment the generate_messages entry below
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)

## Generate messages in the 'msg' folder
# add_message_files(
# FILES
# Message1.msg
# Message2.msg
# )

## Generate services in the 'srv' folder
# add_service_files(
# FILES
# Service1.srv
# Service2.srv
# )

## Generate actions in the 'action' folder
# add_action_files(
# FILES
# Action1.action
# Action2.action
# )

## Generate added messages and services with any dependencies listed here
# generate_messages(
# DEPENDENCIES
# jsk_recognition_msgs# std_msgs
# )

################################################
## Declare ROS dynamic reconfigure parameters ##
################################################

## To declare and build dynamic reconfigure parameters within this
## package, follow these steps:
## * In the file package.xml:
## * add a build_depend and a exec_depend tag for "dynamic_reconfigure"
## * In this file (CMakeLists.txt):
## * add "dynamic_reconfigure" to
## find_package(catkin REQUIRED COMPONENTS ...)
## * uncomment the "generate_dynamic_reconfigure_options" section below
## and list every .cfg file to be processed

## Generate dynamic reconfigure parameters in the 'cfg' folder
# generate_dynamic_reconfigure_options(
# cfg/DynReconf1.cfg
# cfg/DynReconf2.cfg
# )

###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if your package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES pr2_surgery
# CATKIN_DEPENDS jsk_recognition_msgs roscpp roseus rospy std_msgs
# DEPENDS system_lib
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
# include
${catkin_INCLUDE_DIRS}
)

## Declare a C++ library
# add_library(${PROJECT_NAME}
# src/${PROJECT_NAME}/pr2_surgery.cpp
# )

## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure
# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
# add_executable(${PROJECT_NAME}_node src/pr2_surgery_node.cpp)

## Rename C++ executable without prefix
## The above recommended prefix causes long target names, the following renames the
## target back to the shorter version for ease of user use
## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")

## Add cmake target dependencies of the executable
## same as for the library above
# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Specify libraries to link a library or executable target against
# target_link_libraries(${PROJECT_NAME}_node
# ${catkin_LIBRARIES}
# )

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

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

## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# catkin_install_python(PROGRAMS
# scripts/my_python_script
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark executables for installation
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html
# install(TARGETS ${PROJECT_NAME}_node
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark libraries for installation
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html
# install(TARGETS ${PROJECT_NAME}
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
# )

## Mark cpp header files for installation
# install(DIRECTORY include/${PROJECT_NAME}/
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
# FILES_MATCHING PATTERN "*.h"
# PATTERN ".svn" EXCLUDE
# )

## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
# # myfile1
# # myfile2
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )

#############
## Testing ##
#############

## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_pr2_surgery.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()

## Add folders to be run by python nosetests
# catkin_add_nosetests(test)
16 changes: 16 additions & 0 deletions jsk_2024_10_semi/pr2_tubes/config/table_marker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
boxes:
- dimensions:
- 0.5
- 0.3
- 0.2
frame_id: base_footprint
name: table
orientation:
- 3.9531047036326084e-10
- 0.008311730048626616
- 4.293287988035861e-12
- 0.9999654569751891
position:
- 0.7592881917953491
- 0.015209555625915527
- 0.849845826625824
157 changes: 157 additions & 0 deletions jsk_2024_10_semi/pr2_tubes/launch/recognize_wound.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
<launch>
<!--
<node name="usb_cam" pkg="usb_cam" type="usb_cam_node">
<rosparam>
video_device: /dev/video2
</rosparam>
</node>
<node name="hls_color_filter" pkg="opencv_apps" type="hls_color_filter">
<remap from="image" to="usb_cam/image_raw"/>
<rosparam>
debug_view: true
h_limit_max: 10
h_limit_min: 345
s_limit_max: 256
s_limit_min: 77
l_limit_max: 256
l_limit_min: 201
</rosparam>
</node>
<node name="hough_lines" pkg="opencv_apps" type="hough_lines">
<remap from="image" to="hls_color_filter/image"/>
<rosparam>
debug_view: true
</rosparam>
</node>
-->

<group ns="recognize_wound">

<node name="image_decompresser"
pkg="image_transport" type="republish"
args="compressed raw" respawn="true">
<remap from="in" to="/kinect_head/rgb/image_rect_color"/>
<remap from="out" to="decompressed_image"/>
</node>

<node name="depth_decompresser"
pkg="image_transport" type="republish"
args="compressedDepth raw" respawn="true">
<remap from="in" to="/kinect_head/depth_registered/image"/>
<remap from="out" to="decompressed_depth"/>
</node>

<node pkg="jsk_topic_tools" type="synchronize_republish.py" name="synchronize_republish">
<param name="topics" value="[/recognize_wound/decompressed_image, /recognize_wound/decompressed_depth]" type="yaml"/>
<param name="approximate_sync" value="true" />
</node>

<arg name="manager" value="recognize_wound_manager" />

<node pkg="nodelet" type="nodelet" name="$(arg manager)"
args="manager" output="screen"/>

<node pkg="nodelet" type="nodelet" name="decompress_points"
args="load depth_image_proc/point_cloud_xyzrgb $(arg manager)">
<remap from="rgb/camera_info" to="/kinect_head/depth_registered/camera_info"/>
<remap from="rgb/image_rect_color" to="synchronize_republish/pub_00"/>
<remap from="depth_registered/image_rect" to="synchronize_republish/pub_01"/>
<rosparam>
queue_size: 100
</rosparam>
</node>

<node name="transformable_interactive_server"
pkg="jsk_interactive_marker" type="transformable_server_sample">
<rosparam subst_value="true">
display_interactive_manipulator: true
display_interactive_manipulator_only_selected: true
display_description_only_selected: true
</rosparam>
</node>

<node name="transformable_table_markers"
pkg="jsk_interactive_marker" type="transformable_markers_client.py">
<remap from="~server" to="transformable_interactive_server" />
<rosparam subst_value="true">
config_file: $(find pr2_surgery)/config/table_marker.yaml
config_auto_save: true <!-- Use true to save config updated on rviz -->
</rosparam>
</node>

<node name="bbox_array_to_bbox"
pkg="nodelet" type="nodelet"
args="load jsk_pcl_utils/BoundingBoxArrayToBoundingBox $(arg manager)">
<remap from="~input" to="transformable_table_markers/output/boxes" />
<rosparam>
index: 0
</rosparam>
</node>

<node name="attention_clipper_table"
pkg="nodelet" type="nodelet"
args="load jsk_pcl/AttentionClipper $(arg manager)">
<remap from="~input" to="/kinect_head/depth_registered/camera_info" />
<remap from="~input/points" to="depth_registered/points" />
<remap from="~input/box" to="bbox_array_to_bbox/output" />
<rosparam subst_value="true">
use_multiple_attention: false
</rosparam>
</node>
<node name="extract_indices_table"
pkg="nodelet" type="nodelet"
args="load jsk_pcl/ExtractIndices $(arg manager)">
<remap from="~input" to="depth_registered/points" />
<remap from="~indices" to="attention_clipper_table/output/point_indices" />
<rosparam>
keep_organized: true
approximate_sync: true
max_queue_size: 100
</rosparam>
</node>

<node pkg="nodelet" type="nodelet" name="hsi_filter"
args="load jsk_pcl/HSIColorFilter $(arg manager)" output="screen">
<remap from="~input" to="extract_indices_table/output" />
<rosparam>
use_indices: false
keep_organized: true
h_limit_max: 10
h_limit_min: -10
s_limit_max: 255
s_limit_min: 35
i_limit_max: 255
i_limit_min: 0
</rosparam>
</node>

<node pkg="nodelet" type="nodelet" name="euclidean_clustering"
args="load jsk_pcl/EuclideanClustering $(arg manager)" output="screen">
<remap from="~input" to="hsi_filter/output" />
<rosparam>
tolerance: 0.02
min_size: 10
downsample_enable: true
cluster_filter: 1 <!-- only max size cluster is shown! -->
</rosparam>
</node>

<node pkg="nodelet" type="nodelet"
name="cluster_decomposer"
args="load jsk_pcl/ClusterPointIndicesDecomposer $(arg manager)"
output="screen" clear_params="true">
<remap from="~input" to="hsi_filter/output" />
<remap from="~target" to="euclidean_clustering/output" />
<rosparam>
align_boxes: true
align_boxes_with_plane: false
force_to_flip_z_axis: false
use_pca: false
target_frame_id: base_footprint
</rosparam>
</node>

</group>
</launch>
Loading

0 comments on commit 40f423b

Please sign in to comment.