Skip to content

Commit

Permalink
Merge pull request #439 from garaemon/robot-command-interface
Browse files Browse the repository at this point in the history
[jsk_rviz_plugins] Use ~robot_command_buttons parameter to configure …
  • Loading branch information
garaemon committed Aug 5, 2015
2 parents 84b1242 + b922142 commit 1d6b848
Show file tree
Hide file tree
Showing 7 changed files with 219 additions and 396 deletions.
3 changes: 0 additions & 3 deletions jsk_rviz_plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ add_definitions(-DQT_NO_KEYWORDS -g)
#include(${wxWidgets_USE_FILE})
#include_directories( ${wxWidgets_INCLUDE_DIRS} )

qt4_wrap_ui(UIC_FILES
config/robot_command_interface.ui
)
include_directories(${CMAKE_CURRENT_BINARY_DIR})

#set(SOURCE_FILES src/ambient_sound_display.cpp src/ambient_sound_visual.cpp)
Expand Down
13 changes: 13 additions & 0 deletions jsk_rviz_plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,19 @@ This will publish std_msgs/Empty to the topic you designate.
![RobotCommandInterfaceAction](images/robot_command_interface_action.png)

This will call service to /eus_command with jsk_rviz_plugins/EusCommand srv.
All the buttons are configured via `~robot_command_buttons` parameters.
See `robot_command_interface_sample.launch` file to know how to use it.

Parameter format is:
```yaml
robot_command_buttons:
- name: <name, required>
icon: <path to icon file, optional>
type: <"euscommand" or "emptysrv", required>
command: <S expression to send to eusclient, required if type is euscommand>
srv: <service name, required if type is "emptysrv">
- name: ...
```
#### SelectPointCloudPublishAction
![SelectPointCloudPublishAction](images/select_point_cloud_publish_action.png)
Expand Down
56 changes: 56 additions & 0 deletions jsk_rviz_plugins/config/default_robot_command.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
robot_command_buttons:
- name: "Reset Pose"
icon: "package://jsk_rviz_plugins/icons/reset-pose.jpg"
type: euscommand
command: "(send *ri* :angle-vector (send *robot* :reset-pose) 5000))"
- name: "Reset Manip Pose"
icon: "package://jsk_rviz_plugins/icons/reset-manip-pose.jpg"
type: euscommand
command: "(send *ri* :angle-vector (send *robot* :reset-manip-pose) 5000)"
- name: "Init Pose"
icon: "package://jsk_rviz_plugins/icons/init-pose.jpg"
type: euscommand
command: "(send *ri* :angle-vector (send *robot* :init-pose) 5000)"
- name: "Hand reset pose"
icon: "package://jsk_rviz_plugins/icons/hand-reset-pose.jpg"
type: euscommand
command: "(progn (send *robot* :hand :arms :reset-pose) (send *ri* :hand-angle-vector (apply #'concatenate float-vector (send *robot* :hand :arms :angle-vector))))"
- name: "Hand hook pose"
icon: "package://jsk_rviz_plugins/icons/hand-hook-pose.jpg"
type: euscommand
command: "(progn (send *robot* :hand :arms :hook-pose) (send *ri* :hand-angle-vector (apply #'concatenate float-vector (send *robot* :hand :arms :angle-vector))))"
- name: "Hand grasp pose"
icon: "package://jsk_rviz_plugins/icons/hand-grasp-pose.jpg"
type: euscommand
command: "(progn (send *robot* :hand :arms :grasp-pose) (send *ri* :hand-angle-vector (apply #'concatenate float-vector (send *robot* :hand :arms :angle-vector))))"
- name: "Start ABC"
icon: "package://jsk_rviz_plugins/icons/start-abc.png"
type: euscommand
command: "(send *ri* :start-auto-balancer)"
- name: "Start ST"
icon: "package://jsk_rviz_plugins/icons/start-st.png"
type: euscommand
command: "(send *ri* :start-st)"
- name: "Start IMP"
icon: "package://jsk_rviz_plugins/icons/start-imp.png"
type: euscommand
command: "(send *ri* :start-impedance :arms :moment-gain #f(0 0 0) :k-p 1000 :d-p 400)"
- name: "Start IMP for Drill"
icon: "package://jsk_rviz_plugins/icons/start-imp-for-drill.png"
type: euscommand
command: "(send *ri* :start-impedance :rarm :force-gain #f(1 0 0) :moment-gain #f(0 0 0) :k-p 600 :d-p 60)"
- name: "Stop ABC"
icon: "package://jsk_rviz_plugins/icons/stop-abc.png"
type: euscommand
command: "(send *ri* :stop-auto-balancer)"
- name: "Stop ST"
icon: "package://jsk_rviz_plugins/icons/stop-st.png"
type: euscommand
command: "(send *ri* :stop-st)"
- name: "Stop IMP"
icon: "package://jsk_rviz_plugins/icons/stop-imp.png"
type: euscommand
command: "(send *ri* :stop-impedance :arms)"
- name: "sample"
type: emptysrv
srv: "/hoge"
210 changes: 0 additions & 210 deletions jsk_rviz_plugins/config/robot_command_interface.ui

This file was deleted.

6 changes: 6 additions & 0 deletions jsk_rviz_plugins/launch/robot_command_interface_sample.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<launch>
<node pkg="rviz" type="rviz" name="$(anon rviz)"
args="-d $(find jsk_rviz_plugins)/cfg/robot_command_interface_sample.rviz">
<rosparam command="load" file="$(find jsk_rviz_plugins)/config/default_robot_command.yaml" />
</node>
</launch>
Loading

0 comments on commit 1d6b848

Please sign in to comment.