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

EusLisp ver. 10 #718

Draft
wants to merge 195 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
0b0c563
Fix possible memory faults when registering subscribers
Affonso-Gui May 28, 2021
ffb810e
Fix possible memory faults when registering service servers and timer…
Affonso-Gui Oct 26, 2022
d31accf
Ensure stack safety in StoreConnectionHeader
Affonso-Gui Oct 26, 2022
1bbc21a
Add roseus_bt package
Affonso-Gui Jun 16, 2021
51bc26e
(roseus_bt) Parse to service files
Affonso-Gui Jun 16, 2021
a95c10d
(roseus_bt) Add EusActionNode and EusConditionNode
Affonso-Gui Jun 16, 2021
96fab9f
(roseus_bt) Add euslisp roseus_bt package and utilities
Affonso-Gui Jun 16, 2021
bafc633
(roseus_bt) Parse header
Affonso-Gui Jun 16, 2021
f9dd76d
(roseus_bt) Parse action classes
Affonso-Gui Jun 16, 2021
abff74f
(roseus_bt) Parse condition classes
Affonso-Gui Jun 16, 2021
56670ad
(roseus_bt) Parse main function
Affonso-Gui Jun 16, 2021
e0a7e9a
(roseus_bt) Fix namespace of eus nodes
Affonso-Gui Jun 16, 2021
2f9088f
(roseus_bt) Add generate_cpp_file
Affonso-Gui Jun 16, 2021
d9669a5
(roseus_bt) Add generate_cmake_lists
Affonso-Gui Jun 17, 2021
67b10ed
(roseus_bt) Add generate_package_xml
Affonso-Gui Jun 17, 2021
417085f
(roseus_bt) Change action/service file generator
Affonso-Gui Jun 17, 2021
9065274
(roseus_bt) Keep xml_filename in class variable
Affonso-Gui Jun 17, 2021
eb21bf9
(roseus_bt) Fix comment in xml_parser.h
Affonso-Gui Jun 17, 2021
3f3a63c
(roseus_bt) Add create_bt_package executable
Affonso-Gui Jun 17, 2021
1c41cd3
(roseus_bt) Fix compilation errors
Affonso-Gui Jun 17, 2021
4621ff7
(roseus_bt) Remove test executable
Affonso-Gui Jun 18, 2021
10e9558
(roseus_bt) Print warnings on non-global lambda-closures
Affonso-Gui Jun 18, 2021
71830a6
(roseus_bt) Copy model file and use absolute path
Affonso-Gui Jun 18, 2021
13fb481
(roseus_bt) Add roseus_bt:spin
Affonso-Gui Jun 20, 2021
bea8501
(roseus_bt) Add generate_eus_action_server
Affonso-Gui Jun 20, 2021
65a3ad5
(roseus_bt) Add generate_eus_condition_server
Affonso-Gui Jun 20, 2021
ff899ab
(roseus_bt) Add separate template generator class
Affonso-Gui Jun 20, 2021
5c5f316
(roseus_bt) Replace const char* with std::string
Affonso-Gui Jun 20, 2021
f3604b5
(roseus_bt) Use external symbol roseus_bt:spin in template
Affonso-Gui Jun 20, 2021
d9340f1
(roseus_bt) Add command line arguments
Affonso-Gui Jun 20, 2021
6dc320e
(roseus_bt) Fix bugs in euslisp file generation
Affonso-Gui Jun 20, 2021
e3a07d2
(roseus_bt) Query before overwriting files
Affonso-Gui Jun 20, 2021
c34455f
(roseus_bt) Use const strings on function arguments
Affonso-Gui Jun 20, 2021
863ab21
(roseus_bt) Add subscriber nodes
Affonso-Gui Jun 21, 2021
0025a1c
(roseus_bt) Add roseus_bt/eus_nodes.h header file
Affonso-Gui Jun 21, 2021
98f7fe6
(roseus_bt) Add eus-like function names
Affonso-Gui Jun 30, 2021
a492167
(roseus_bt) Add comments on roseus_bt:set-output usage
Affonso-Gui Jun 30, 2021
03f0b83
(roseus_bt) Add hyphen-spelled package nickname
Affonso-Gui Jun 30, 2021
80e2c39
(roseus_bt) Add maybe_push_message_package as common utility
Affonso-Gui Jun 30, 2021
b9fa96b
(roseus_bt) Don't write eus files if not needed
Affonso-Gui Jun 30, 2021
6180919
(roseus_bt) Skip copy_xml_file if source is equal to destination
Affonso-Gui Jun 30, 2021
b3241e8
(roseus_bt) Use model filename as default executable name
Affonso-Gui Jul 6, 2021
948496b
(roseus_bt) Allow to assign multiple model files
Affonso-Gui Jul 6, 2021
671a86c
(roseus_bt) Add euslisp sample files
Affonso-Gui Jul 6, 2021
ce8baea
(roseus_bt) Update euslisp sample task
Affonso-Gui Jul 7, 2021
abf8a81
(roseus_bt) Add sample model files
Affonso-Gui Jul 7, 2021
1602ac3
(roseus_bt) Suppress return value on eus_condition_server template
Affonso-Gui Jul 7, 2021
3768b9a
(roseus_bt) Avoid extra newline after comment on eus_action_server te…
Affonso-Gui Jul 7, 2021
5f1d434
(roseus_bt) Fix bug on server_name/service_name formatting
Affonso-Gui Jul 7, 2021
91369b5
(roseus_bt) Search in all BehaviorTrees for server_name/service_name
Affonso-Gui Jul 7, 2021
171b619
(roseus_bt) Update target xml_filename location
Affonso-Gui Jul 7, 2021
be4f6c5
(roseus_bt) Avoid extra newlines after registering on cpp main function
Affonso-Gui Jul 7, 2021
85afe52
(roseus_bt) Ensure valid package name
Affonso-Gui Jul 7, 2021
bb990b2
(roseus_bt) Use different IDs when initializing demo task with broom …
Affonso-Gui Jul 8, 2021
7a870f1
(roseus_bt) Add create_bt_tutorials executable
Affonso-Gui Jul 8, 2021
1bda54c
(roseus_bt) Rename function port_node_to_message_description -> forma…
Affonso-Gui Jul 8, 2021
a3ee38e
(roseus_bt) Add load guard in package_generator.h
Affonso-Gui Jul 8, 2021
3370cf0
(roseus_bt) Only split euslisp server files for reactive conditions
Affonso-Gui Jul 8, 2021
c466877
(roseus_bt) Ensure newline after load_files in eus_server_template
Affonso-Gui Jul 8, 2021
ad83020
(roseus_bt) Wait for topic message on t04_subscriber
Affonso-Gui Jul 8, 2021
9b42bba
(roseus_bt) Add roseus_bt.rosinstall
Affonso-Gui Jul 8, 2021
1ebbf81
(roseus_bt) Add README files
Affonso-Gui Jul 9, 2021
5c76756
(roseus_bt) Move server_name/service_name definition to node pallete
Affonso-Gui Jul 9, 2021
b2b82ef
(roseus_bt) Avoid pushing duplicates on collect_eus_actions/conditions
Affonso-Gui Jul 9, 2021
ef7b03c
(roseus_bt) Verify the xml file syntax
Affonso-Gui Jul 9, 2021
c67d29a
(roseus_bt) Fix bug when dealing with multiple duplicated nodes
Affonso-Gui Jul 10, 2021
8b6d0b8
(roseus_bt) Add t07_xacro tutorial
Affonso-Gui Jul 10, 2021
312234c
(roseus_bt) Spell check README.md
Affonso-Gui Jul 10, 2021
96bdff8
(roseus_bt) Verify root and TreeNodesModel in check_xml_file
Affonso-Gui Jul 10, 2021
9f63918
(roseus_bt) Add custom exceptions
Affonso-Gui Jul 12, 2021
503e5da
(roseus_bt) Add logging
Affonso-Gui Jul 12, 2021
dab791f
(roseus_bt) Declare template as static member variable
Affonso-Gui Jul 12, 2021
964227e
(roseus_bt) Downgrade cmake minimum required version
Affonso-Gui Aug 13, 2021
0553584
(roseus_bt) Update README title case
Affonso-Gui Aug 13, 2021
78b66da
(roseus_bt) Update .rosinstall
Affonso-Gui Aug 16, 2021
b8e66aa
(roseus_bt) Fix trailing whitespace in nodes.l
Affonso-Gui Aug 16, 2021
b7abedc
(roseus_bt) Add checks for accept-cb
Affonso-Gui Aug 16, 2021
304a7c3
(roseus_bt) Add additional checks for local context on global callbacks
Affonso-Gui Aug 24, 2021
a8b5ed4
Changes to 'print-ros-msg'
Affonso-Gui Mar 6, 2019
1dc4a29
Update sigint and error handlers
Affonso-Gui Apr 14, 2021
10c3a9e
Update script handlers
Affonso-Gui Apr 14, 2021
1a14594
Always use ROSCONSOLE_DEFAULT_NAME on set-logger-level
Affonso-Gui Apr 14, 2021
6b4d133
Give ros::spin-once more meaningful return values
Affonso-Gui Apr 14, 2021
faf2d58
Allow interruptions on ROS sleep functions
Affonso-Gui Apr 14, 2021
0ff260d
Shutdown ros before clearing static data on exit to avoid eventual locks
Affonso-Gui Aug 16, 2021
dd9de9e
(roseus_bt) Add groupname option to condition servers
Affonso-Gui Sep 12, 2022
f792479
(roseus_bt) Use classes instead of macros
Affonso-Gui Sep 21, 2021
2d6cdd4
(roseus_bt) Call set-succeeded from the :execute-cb method
Affonso-Gui Sep 22, 2021
351058b
(roseus_bt) Use :is-active to evaluate ongoing requests
Affonso-Gui Sep 22, 2021
96d170d
(roseus_bt) Use trace level on verbose option
Affonso-Gui Oct 8, 2021
83353cc
(roseus_bt) Format tracing messages
Affonso-Gui Oct 8, 2021
dd1649f
(roseus_bt) Add port name to trace log
Affonso-Gui Oct 8, 2021
b6cd774
(roseus_bt) Fix fmt::format indexing in format_node_body
Affonso-Gui Oct 8, 2021
58db1ee
(roseus_bt) Add monitor-groupname for separate goal and cancel handlers
Affonso-Gui Sep 22, 2021
08f7da8
(roseus_bt) Add groupname option to condition nodes
Affonso-Gui Feb 24, 2022
46ccea6
(roseus_bt) Check server connections at init time
Affonso-Gui Apr 18, 2022
ea3ec60
(roseus_bt) Stablish persistent connection with service client at ini…
Affonso-Gui Apr 18, 2022
c4fb029
(roseus_bt) Add sleep in sample task loop
Affonso-Gui Apr 18, 2022
3fff387
(roseus_bt) Increase default spin rate
Affonso-Gui Apr 18, 2022
c8979f3
(roseus_bt) Update RetryUntilSuccessful name
Affonso-Gui Apr 18, 2022
5fb4262
(roseus_bt) Add rosbridgecpp submodule
Affonso-Gui Apr 18, 2022
28f0fc3
(roseus_bt) Add eus_remote_action_node.h
Affonso-Gui Apr 18, 2022
8654296
(roseus_bt) Add EusRemoteAction generation code
Affonso-Gui Apr 18, 2022
99161ad
(roseus_bt) Add t08_multimaster
Affonso-Gui Apr 18, 2022
76f9f46
(roseus_bt) Add ws_action_client base
Affonso-Gui Apr 21, 2022
13d1951
(roseus_bt) Subscribe remote action results
Affonso-Gui Apr 21, 2022
072127b
(roseus_bt) Enable halting remote actions
Affonso-Gui Apr 21, 2022
b6a3136
(roseus_bt) Fix message type parameter in EusRemoteActionNode
Affonso-Gui Apr 25, 2022
3a31050
(roseus_bt) Enable input and output ports in remote actions
Affonso-Gui Apr 25, 2022
1aedf61
(roseus_bt) Allow to set host_name and host_port dynamically
Affonso-Gui Apr 25, 2022
fed80fe
(roseus_bt) Add EusRemoteCondition node
Affonso-Gui Apr 25, 2022
0bcd89e
(roseus_bt) Indent
Affonso-Gui Apr 25, 2022
651a363
(roseus_bt) Reduce duplicate formatting functions
Affonso-Gui Apr 25, 2022
24df8b7
(roseus_bt) Add default file logger
Affonso-Gui Apr 25, 2022
0cef7d5
(roseus_bt) Add 'update_field_name' to set output ports once at a time
Affonso-Gui Apr 25, 2022
ec9608e
(roseus_bt) Move #DEBUG definition to generated files
Affonso-Gui Apr 25, 2022
5607ca8
(roseus_bt) Add generate_eus_remote_action_server and generate_eus_re…
Affonso-Gui Apr 25, 2022
8b7c18d
(roseus_bt) Split euslisp files for each host
Affonso-Gui Apr 25, 2022
80b7f10
(roseus_bt) Enable splitting eus files in tutorials
Affonso-Gui Apr 25, 2022
e7ff1ba
(roseus_bt) Fix file splitting with mixed remote and local nodes
Affonso-Gui Apr 25, 2022
7575c02
(roseus_bt) Enable non-ROS input ports in remote nodes
Affonso-Gui Apr 26, 2022
1aab7cd
(roseus_bt) Avoid unnecessary declarations at sendGoal and sendRequest
Affonso-Gui Apr 26, 2022
52ea9e9
(roseus_bt) Update t08_multimaster
Affonso-Gui Apr 26, 2022
130ef88
(roseus_bt) Add submodule directory
Affonso-Gui Apr 26, 2022
8267432
(roseus_bt) Update submodules at build time
Affonso-Gui Apr 26, 2022
2aaceea
(roseus_bt) Add basic_types.h
Affonso-Gui Apr 27, 2022
c5fa11a
(roseus_bt) Change subscriber port names
Affonso-Gui Apr 28, 2022
794abfc
(roseus_bt) Allow to set default topic_name at Subscriber nodes
Affonso-Gui Apr 28, 2022
399dd0d
(roseus_bt) Add RemoteSubscriber
Affonso-Gui Apr 28, 2022
1e32632
(roseus_bt) Fix bug in convertFromString
Affonso-Gui Apr 28, 2022
1db0bd0
(roseus_bt) Explicitly add subscriber and subtree ports in model files
Affonso-Gui Apr 28, 2022
449fd34
(roseus_bt) Default action-node's preemption callback to 'signals-can…
Affonso-Gui May 27, 2022
e00a5c3
(roseus_bt) Update the reactive sample code and documentation to use …
Affonso-Gui May 27, 2022
0cb7edd
(roseus_bt) Add more documentation on reactive nodes
Affonso-Gui May 27, 2022
5cfa4c6
(roseus_bt) Fix typo in warning
Affonso-Gui May 27, 2022
19e480e
(roseus_bt) Log and return final tree status on completion
Affonso-Gui May 27, 2022
4fb3a9b
(roseus_bt) Add received_port in Subscriber nodes to differentiate re…
Affonso-Gui May 27, 2022
571d273
(roseus_bt) Update samples to use received_port in subscribers
Affonso-Gui May 27, 2022
c95d128
(roseus_bt) Update the subscriber documentation
Affonso-Gui May 27, 2022
1af595b
(roseus_bt) Update the remote tutorial documentation
Affonso-Gui May 27, 2022
45ba1db
(roseus_smach) Adapt to updated assoc key (see EusLisp/436)
Affonso-Gui Jun 7, 2022
7ef0876
Allow optional argument on set-logger-level for backward compability
Affonso-Gui Aug 11, 2022
b6267cd
Fix typos in ros::roseus warning
Affonso-Gui Sep 7, 2022
e329a6a
(roseus_bt) Update create_bt_tutorials help description
Affonso-Gui Sep 26, 2022
efef44d
(roseus_bt) Remove check-fn-closure
Affonso-Gui Sep 26, 2022
5d9ca94
(roseus_bt) Always wait for result in RemoteCondition
Affonso-Gui Oct 10, 2022
af98093
(roseus_bt) Fix misspell: SetUInt -> SetUint
Affonso-Gui Oct 10, 2022
7037b16
(roseus_bt) Generate server launch files
Affonso-Gui Oct 20, 2022
57982d5
(roseus_bt) Force hyphens in euslisp file names
Affonso-Gui Oct 20, 2022
3c1332c
(roseus_bt) Add CopyDocument class to avoid unnecessary dumping and p…
Affonso-Gui Oct 21, 2022
49efe4f
(roseus_bt) Allow to parse to basic ros types in remote action
Affonso-Gui Oct 21, 2022
f4e6cc2
(roseus_bt) Add command line arguments for initializing blackboard va…
Affonso-Gui Oct 21, 2022
58c26a0
(roseus_bt) Standardize namespaces and loadguards
Affonso-Gui Oct 21, 2022
e48db95
(roseus_bt) Add positional argument check and negative number support…
Affonso-Gui Oct 21, 2022
0b2787a
(roseus_bt) Add implicit blackboard conversions for int8, int16, and …
Affonso-Gui Oct 21, 2022
b076c6f
(roseus_bt) Decrease sleep time in remote nodes
Affonso-Gui Oct 22, 2022
163ba7d
(roseus_bt) Use CopyDocument in remote subscriber
Affonso-Gui Oct 23, 2022
e144185
(roseus_bt) Inform topic type in remote subscribers
Affonso-Gui Oct 23, 2022
5ad1ea6
(roseus_bt) Add single variable constructor in CopyDocument
Affonso-Gui Oct 23, 2022
bd8e49b
(roseus_bt) Avoid duplicated header generation
Affonso-Gui Oct 23, 2022
245d10d
(roseus_bt) Drop support for type unsafe message_field subscriber option
Affonso-Gui Oct 23, 2022
e717c22
(roseus_bt) Increase server unregister_timeout (https://github.com/kn…
Affonso-Gui Oct 23, 2022
eb31cd9
(roseus_bt) Remove comma separation in package.xml generator
Affonso-Gui Oct 25, 2022
b5746a5
(roseus_bt) Enforce '/' on remote topics
Affonso-Gui Oct 25, 2022
c75ce1a
(roseus_bt) Raise runtime errors when blackboard entry is not found
Affonso-Gui Oct 25, 2022
255da5a
(roseus_bt) Initialize subscriber ports
Affonso-Gui Oct 25, 2022
eb42df3
Add store_pointer helper to conceal stack manipulation
Affonso-Gui Oct 26, 2022
9c5bfba
Remove redundant stack operations in roseus.cpp
Affonso-Gui Oct 26, 2022
4242c95
Use sys::*gc-debug* instead of gc-hook in tests
Affonso-Gui Nov 4, 2022
f18a531
(roseus_bt) Better euslisip function formatting with underscores
Affonso-Gui Nov 7, 2022
41f7dab
Unregister oneshot timers after execution
Affonso-Gui Nov 11, 2022
591df56
Allow to use :groupname nil for default groupname in ros functions
Affonso-Gui Nov 9, 2022
f00abc5
Fix Wmisleading-indentation compilation warning
Affonso-Gui Nov 9, 2022
c8f9992
Supress thread warnings
Affonso-Gui Nov 9, 2022
cc8e381
(roseus_bt) Avoid CMake errors on bloom release
Affonso-Gui Nov 11, 2022
599c466
Add mutex locks for static data assignment
Affonso-Gui Nov 11, 2022
866e89b
Remove compile warnings in roseus_c_util.c
Affonso-Gui Nov 11, 2022
5fcecaf
Avoid memory leaks when removing function helpers
Affonso-Gui Nov 11, 2022
0302c13
(roseus_bt) define result_ member as Document to avoid having the all…
Affonso-Gui Nov 14, 2022
e3f5f3f
(roseus_bt) Throw errors on failed requests
Affonso-Gui Nov 15, 2022
d1c519b
(roseus_bt) Throw errors on failed remote service calls
Affonso-Gui Nov 15, 2022
2c81c8e
add common_argument_mapping.h
knorth55 Nov 21, 2022
603d3b2
(roseus_bt) Throttle actions/status topic for performance
Affonso-Gui Nov 11, 2022
047cc1e
add rosparam_argument_mapping.h
knorth55 Nov 21, 2022
5d2c79a
remove ros args in parse_command_line
knorth55 Nov 21, 2022
37ab87d
(roseus_bt) Timeout cancel and check result in remote actions
Affonso-Gui Nov 21, 2022
6ea6ee9
(roseus_bt) Remove unused imports and minor style changes in argument…
Affonso-Gui Nov 21, 2022
899ac1a
(roseus_bt) Add optional timeout parameter to the action template
Affonso-Gui Nov 21, 2022
cb7c49b
(roseus_bt) Use ros::package::getPath when loading model file
Affonso-Gui Nov 21, 2022
fac80bf
(roseus_bt) Set timeout as an argument in cancelGoal()
Affonso-Gui Nov 22, 2022
58abd52
(roseus_bt) Use SubTreePlus instead of SubTree
Affonso-Gui Nov 25, 2022
cc30486
(roseus_bt) Use ros::ok in roseus_bt:spin
Affonso-Gui Feb 16, 2023
bff5b60
(roseus_bt) Fix tutorial SubTreePlus port remapping
Affonso-Gui Feb 16, 2023
e34aa5e
(roseus_bt) Update sample readme
Affonso-Gui Feb 16, 2023
98abcd2
(roseus_bt) Update links to jsk-ros-pkg
Affonso-Gui Feb 16, 2023
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule ".travis"]
path = .travis
url = https://github.com/jsk-ros-pkg/jsk_travis
[submodule "roseus_bt/include/rosbridgecpp"]
path = roseus_bt/include/rosbridgecpp
url = https://github.com/ppianpak/rosbridgecpp
2 changes: 1 addition & 1 deletion roseus/cmake/roseus.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ macro(generate_eusdoc _lispfile)
get_filename_component(_name ${_lispfile} NAME_WE)
set(_lisppath "${CMAKE_CURRENT_SOURCE_DIR}/${_lispfile}")
set(_mdfile "${_name}.md")
set(_generate_eusdoc_command "\\\"(setq lisp::*error-handler* 'exit)\\\" \\\"(load \\\\\\\"${_lisppath}\\\\\\\")\\\" \\\"(make-document \\\\\\\"${_lisppath}\\\\\\\" \\\\\\\"${_mdfile}\\\\\\\" \\\\\\\"${_pkg_name}\\\\\\\")\\\" \\\"(exit)\\\" ")
set(_generate_eusdoc_command "\\\"(install-handler error #'(lambda (c) (lisp::print-error-message c) (exit 1)))\\\" \\\"(load \\\\\\\"${_lisppath}\\\\\\\")\\\" \\\"(make-document \\\\\\\"${_lisppath}\\\\\\\" \\\\\\\"${_mdfile}\\\\\\\" \\\\\\\"${_pkg_name}\\\\\\\")\\\" \\\"(exit)\\\" ")
separate_arguments(_generate_eusdoc_command_list WINDOWS_COMMAND "${_generate_eusdoc_command}")
#set(_roseus_exe roseus)
find_program(_roseus_exe roseus)
Expand Down
39 changes: 15 additions & 24 deletions roseus/euslisp/roseus-utils.l
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,31 @@
(ros::roseus-add-srvs "dynamic_reconfigure")
(ros::roseus-add-msgs "dynamic_reconfigure")

(defun print-ros-msg (msg &optional (rp (find-package "ROS"))
(ro ros::object) (nest 0) (padding " "))
(defun print-ros-msg (msg &optional (strm *standard-output*) (tab 0) (padding " "))
(assert (streamp strm) (format nil "Stream Expected in: ~s~%" strm))
(dolist (s (let ((slt (send msg :slots)))
;; `s' is a list of slots unique to the msg object
;; i.e. slots present in `ro' and inherited by `msg' are filtered
(map nil #'(lambda (obj) (setq slt (remove obj slt :key #'car :count 1)))
(send ro :slots))
(send ros::object :slots))
slt))
(let ((sm (car s)))
(when (and (symbolp sm) (eq (symbol-package sm) rp))
(when (symbolp sm)
(dotimes (i tab) (format strm padding))
(format strm "~A: " (string-downcase (string-left-trim "_" (symbol-string sm))))
(cond
((derivedp (cdr s) ro)
(dotimes (i nest) (format t padding))
(format t ":~A -- ~A~%"
(string-downcase (string-left-trim "_" (symbol-string sm)))
(send (class (cdr s)) :name))
(print-ros-msg (cdr s) rp ro (1+ nest) padding))
((derivedp (cdr s) ros::object)
(terpri strm)
(print-ros-msg (cdr s) strm (1+ tab) padding))
((and (listp (cdr s))
(derivedp (cadr s) ro))
(dotimes (i nest) (format t padding))
(format t ":~A [ ~A ]~%"
(string-downcase (string-left-trim "_" (symbol-string sm)))
(send (class (cadr s)) :name))
(dotimes (i (1+ nest)) (format t padding)) (format t "[~%")
(derivedp (cadr s) ros::object))
(terpri strm)
(dolist (ss (cdr s))
(print-ros-msg ss rp ro (+ nest 2) padding))
(dotimes (i (1+ nest)) (format t padding)) (format t "]~%")
)
(dotimes (i (1+ tab)) (format strm padding))
(format strm "- ~%")
(print-ros-msg ss strm (+ tab 2) padding)))
(t
(dotimes (i nest) (format t padding))
(format t ":~A~%" (string-downcase (string-left-trim "_" (symbol-string sm))))
(dotimes (i nest) (format t padding))
(print (cdr s)))
)))))
(format strm "~S~%" (cdr s))))))))

;; Sensors
(ros::roseus-add-msgs "sensor_msgs")
Expand Down
35 changes: 20 additions & 15 deletions roseus/euslisp/roseus.l
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,39 @@

(in-package "ROS")

(defun ros::roseus-sigint-handler (sig code)
(ros::ROS-WARN (format nil "ros::roseus-sigint-handler ~A" sig))
(defvar ros::*compile-message* nil)
(defvar ros::*static-data-vector*
(vector
(make-hash-table :size 32 :test #'string=) ;; s_mapSubscribed
(make-hash-table :size 32 :test #'string=) ;; s_mapServiced
(make-hash-table :size 16 :test #'string=) ;; s_mapTimered
))


(defun ros::roseus-sigint-handler (sig)
(ros::ros-error "Received shutdown request (SIGINT)")
(exit 1))

(defun ros::roseus-error (code msg1 form &optional (msg2))
(format *error-output* "~C[1;3~Cm~A roseus-error: ~A"
#x1b (+ 1 48) *program-name* msg1)
(if msg2 (format *error-output* " ~A" msg2))
(if form (format *error-output* " in ~s" form))
(format *error-output* ", exitting...~C[0m~%" #x1b)
(exit 1))
(defun ros::roseus-error (err)
(when (send err :callstack)
(lisp::print-callstack (send err :callstack) lisp::*max-callstack-depth*))
(let ((errstr (with-output-to-string (str) (lisp::print-error-message err str))))
(ros::ros-error errstr))
(exit 1))

;; check if this process is created by roslaunch
(when (let ((arg (car (last lisp::*eustop-argument*))))
(and (>= (length arg) 7) (string= "__log:=" (subseq arg 0 7))))
(ros::ROS-INFO "install ros::roseus-sigint-handler")
(setq lisp::*exit-on-fatal-error* t)
(lisp::install-error-handler 'ros::roseus-error)
(unix:signal unix::sigint 'ros::roseus-sigint-handler)
(install-handler error 'ros::roseus-error)
(install-handler unix::sigint-received 'ros::roseus-sigint-handler)
(unix:signal unix::sighup 'ros::roseus-sigint-handler)
(defmacro user::do-until-key (&rest forms) `(while t ,@forms))
(defun user::y-or-n-p (&rest args) t))

(defun ros::roseus (name &key
(anonymous t)
(logger "ros.roseus")
(level ros::*rosinfo*)
(args lisp::*eustop-argument*))
"Register roseus client node with the master under the specified name"
Expand All @@ -54,11 +61,9 @@
(setf (elt lisp::*eustop-argument* i)
(format nil "(warning-message 1 \"ignore ~a~%\")"
(elt lisp::*eustop-argument* i)))))
(ros::set-logger-level logger level)
(ros::set-logger-level level)
)))

(setq ros::*compile-message* nil)

(shadow 'object *package*)
(defclass ros::object
:super propertied-object
Expand Down
Loading