Skip to content
This repository was archived by the owner on May 16, 2025. It is now read-only.

Conversation

gaya-
Copy link
Member

@gaya- gaya- commented Oct 21, 2016

Currently, the msg-type argument of make-message has to be a string of format "package/message_type":

CL-USER> (roslisp:make-message "geometry_msgs/Twist"
                               (:x :linear) 1
                               (:z :angular) 2)
[GEOMETRY_MSGS-MSG:TWIST
   LINEAR:
     (GEOMETRY_MSGS-MSG:VECTOR3 (:X . 1) (:Y . 0.0) (:Z . 0.0))
   ANGULAR:
     (GEOMETRY_MSGS-MSG:VECTOR3 (:X . 0.0) (:Y . 0.0) (:Z . 2))]

I suggest also supporting class name as message types, similar to how it is done with services:

CL-USER> (roslisp:call-service "/spawn" 'turtlesim-srv:spawn
                               :x 5 :y 5 :theta 1.0)
CL-USER> (roslisp:make-request "moveit_msgs/getpositionfk")
CL-USER> (roslisp:make-request 'moveit_msgs-srv:getpositionfk)
  1. Using strings here instead of actual message classnames is not very convenient, because if one forgets to add a dependency on the message package the failure will only come up at runtime.
  2. Another advantage of using symbols is that it has autocompletion
  3. One can also jump straight to the message definition if it's a valid classname

This PR will then allow:

CL-USER> (roslisp:make-message 'geometry_msgs-msg:twist
                               (:x :linear) 1
                               (:z :angular) 2)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant