I have been having an issue creating a custom action message and unable to figure out the error.
When I use this :
It compiles well and generates all the action topics.
But when I change the above to :
I get an error as such:
I believe I added all the necessary dependencies to the CMakelists file. Could anyone look and help me out.
I am guessing that there is a package for type
and should include in the dependencies also? I am not sure
Hi @mamojiz97 ,
Point by itself does not exist as a datatype. It is a sub-type under
You should re-write the line as
You can use
geometry_msgs/Point32 for 32 bit float.
You can use
geometry_msgs/Point for 64 bit float.
Point32 type is used in most cases as it gives you precision up to 7 decimal places, which is sufficient for most applications.
Point would be useful only in cases of GPS-like systems where you need (very) high-precision, because you would need up to 9 or 10 places of decimal values.
Your custom action message definition seems to be quite vague.
Why have you defined a
count variable with
Point32 / Point datatype has
x , y , z as three
If you are just counting something you could just use
Anyways, it was just my suggestion. You can use your definitions as per your requirements.
Thank You so much for your help. While I posted the question, I had found the solution as well.
I will make the necessary changes like you said. The variables names are just left as is just until the message was compiled.
I do have a following question though. Where should I search for the datatype of a sub type?
I just came across an article but it wasn’t a dataset to show that these ‘so and so’ are sub types of this datatype.
Hi @mamojiz97 ,
The best way is to do
rosmsg list in your computer (or on the machine on which ROS is installed).
rosmsg list will list all messages in your computer, you can scroll down and choose the message type that you wish to use.
Here is an example: (this lists all ros package messages with “Point” in its name)
user:~$ rosmsg list | grep Point
geometry_msgs/Point # <<<---------- Point64 msg
geometry_msgs/Point32 # <<<---------- Point32 msg
But there is a caveat. Doing
rosmsg list will only show the message packages installed on the system that is running ROS. So if you are looking for a specific message type that requires a
ros-noetic-<pkg> to be installed on your system, then that message will not show up when you do
rosmsg list until you install that specific ros package.
Finally, to know how a message is defined, you can do
rosmsg show <msg_full_name>
user:~$ rosmsg show geometry_msgs/Point32
So your options are as follows:
- Try to make use of the basic message types that gets installed with ROS default installation.
- Google (or search the web) for the specific message if it is not installed and install the package.
- Create your own message type, but make sure you do not multiple copies of same message.
I hope this clarified your doubt(s).