Ask Your Question

Generate ROS msg from asn1 or c file

asked 2017-05-10 09:14:14 -0500

fehlfarbe gravatar image


I'm writing a driver for a VANET transceiver (IEEE 802.11p WLAN) to display vehicles and infrastructures that send CAM/DENM messages. The device redirects all received VANET messages via Ethernet/UDP to my ROS computer. The specifications for the message structures are in asn1 format. So I generated C-code with the ASN.1 compiler asn1c to decode the received UDP packets into C structures. But now I want to publish these structures as ROS messages so I have to create .msg files. I don't want to create these messages by hand because the VANET messages contain many nested containers and so on.

Is there a tool to generate ROS msg files from asn1 or c files?

edit retag flag offensive close merge delete


I don't think there's a tool to generate ROS msg files from asn1 files, but if you can file an asn1 parser library it shouldn't be too hard to write one.

ahendrix gravatar image ahendrix  ( 2017-05-10 14:39:28 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-05-10 12:01:44 -0500

madapeti gravatar image

This is a question I would consider as important as well, and something for which I have yet to find a proper solution.

There is a related question here on ROS Answers already From structure to message, however it still requires the availability of ROS message types.

Overall the approach requires the manual creation of multiple (several) message types for nested structs as well as the definition of things like hash functions (ros::message_traints::MD5Sum< MyType >::value()) for the custom type.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2017-05-10 09:14:14 -0500

Seen: 300 times

Last updated: May 10 '17