Skip to content

Commit

Permalink
Allow to recursively set alists in ros::set-param
Browse files Browse the repository at this point in the history
  • Loading branch information
Affonso-Gui committed May 1, 2022
1 parent dd8d2c5 commit 47543fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions roseus/euslisp/roseus.l
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,15 @@
params)
,@args))

;; ros::set-param definition to allow setting nested values
(defun set-param (key val)
(if (and (listp val) (every #'consp val))
(dolist (l val)
(set-param (concatenate string key "/" (car l)) (cdr l)))
(raw-setparam key val))
t)


(defun ros-message-destructuring-bind-parse-arg (msg params)
"this function returns a list like ((symbol value) (symbol value) ...).
always the rank of list is 2"
Expand Down
2 changes: 1 addition & 1 deletion roseus/roseus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2083,7 +2083,7 @@ pointer ___roseus(register context *ctx, int n, pointer *argv, pointer env)
" (ros::advertise-service \"add_two_ints\" roseus::AddTwoInts #'add-two-ints)");
defun(ctx,"UNADVERTISE-SERVICE",argv[0],(pointer (*)())ROSEUS_UNADVERTISE_SERVICE, "Unadvertise service");

defun(ctx,"SET-PARAM",argv[0],(pointer (*)())ROSEUS_SET_PARAM, "key value\n\n""Set parameter");
defun(ctx,"RAW-SETPARAM",argv[0],(pointer (*)())ROSEUS_SET_PARAM, "key value\n\n""Set parameter");
defun(ctx,"GET-PARAM",argv[0],(pointer (*)())ROSEUS_GET_PARAM, "key\n\n""Get parameter");
defun(ctx,"GET-PARAM-CACHED",argv[0],(pointer (*)())ROSEUS_GET_PARAM_CACHED, "Get chached parameter");
defun(ctx,"HAS-PARAM",argv[0],(pointer (*)())ROSEUS_HAS_PARAM, "Check whether a parameter exists on the parameter server.");
Expand Down

0 comments on commit 47543fa

Please sign in to comment.