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

Revert "Add robot init function to create *ri* and robot instance" #224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion pr2eus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ if(CATKIN_ENABLE_TESTING)
add_rostest(test/robot-no-clock.test)
add_rostest(test/default-ri-test.test)
add_rostest(test/speak-test.test)
add_rostest(test/robot-init-test.test)
endif()

generate_eusdoc(robot-interface.l)
Expand Down
3 changes: 0 additions & 3 deletions pr2eus/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,5 @@
<run_depend>dynamic_reconfigure</run_depend>
<run_depend>sound_play</run_depend>

<export>
<pr2eus robot-name="pr2" interface-file="${prefix}/pr2-interface.l" />
</export>
</package>

41 changes: 0 additions & 41 deletions pr2eus/robot-interface.l
Original file line number Diff line number Diff line change
Expand Up @@ -1683,45 +1683,4 @@ send-action [ send message to action server, it means robot will move ]"
(ros::service-call (format nil "~A/~A/~A/set_parameters" node-name costmap-name inflation-name) req)
))

;;
;; robot-init
;;
(defun robot-init (&optional (robot-name (ros::get-param "/robot/type")))
"Initialize robot-model and robot-interface instances respectively, such as *pr2* and *ri*.
Behavior:
1. Without /robot/type and argument, or no interface file is found, robot instance and interface instance are not created and errors are invoked.
2. If argument are specified and robot interface file is found, robot instance and interface with given name are created.
3. If no argument is specified, /robot/type ROSPARAM is set, and robot interface file is found, robot instance and interface with given name are created.
Typical usage:
(robot-init) ;; With setting /robot/type ROSPARAM anywhere.
(robot-init (or (ros::get-param \"/robot/type\") \"pr2\")) ;; If /robot/type ROSPARAM is specified, use it. Otherwise, use \"pr2\" by default.
Configuring user-defined robot:
This function searches robot interface file from rospack plugins.
If user want to use their own robots from robot-init function,
please write export tag in [user_defined_rospackage]/package.xml as pr2eus/package.xml.
"
(let* (;; Check existence ros::rospack-plugins for robot-name-list and interface-file-list.
;; For example, old deb environment before ros::rospack-plugins is committed.
(robot-name-list
(if (fboundp 'ros::rospack-plugins)
(mapcar #'cdr (ros::rospack-plugins "pr2eus" "robot-name"))
(piped-fork-returns-list "rospack plugins --attrib=robot-name pr2eus | cut -d\\ -f2")))
(interface-file-list
(if (fboundp 'ros::rospack-plugins)
(mapcar #'cdr (ros::rospack-plugins "pr2eus" "interface-file"))
(piped-fork-returns-list "rospack plugins --attrib=interface-file pr2eus | cut -d\\ -f2")))
(robot-name-interface-file-list
(assoc robot-name (mapcar #'(lambda (x y) (list x y))
robot-name-list interface-file-list)
:test #'string=)))
(cond
((or (not robot-name-interface-file-list)
(not (probe-file (cadr robot-name-interface-file-list))))
(error ";; No such robot interface setting are defined ~A, or interface file found ~A!!~%" robot-name (cadr robot-name-interface-file-list))
nil)
(t
(require (cadr robot-name-interface-file-list))
(funcall (eval (read-from-string (format nil "#'~A-init" robot-name))))
))))

(provide :robot-interface "robot-interface.l")
34 changes: 0 additions & 34 deletions pr2eus/test/robot-init-test.l

This file was deleted.

4 changes: 0 additions & 4 deletions pr2eus/test/robot-init-test.test

This file was deleted.