omerfaruksayar / CANParserCreator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CANParserCreator for ROS1

Requeriments

    catkin_tools 0.9.0
    python3 - pip

About

A tool to generate CAN DBC parser package using cantools (https://cantools.readthedocs.io/en/latest/). Generates a virtual environment and installs cantools and chardet (https://pypi.org/project/chardet/) (To detect encoding format of the dbc file). After the shell script creates a ROS1 package using catkin and adjust the values in package.xml, python script generates a rosnode which subscribes to name given topic and publishes ros messages to topics according to the signal names from the DBC file using the header and the source file generated by cantool. Also incomming messages from ROS in the right ROS-Message format will be published back to a given topic as can_msgs/Frame

ROS API

CAN to ROS Subscribed Topic: /inboundSubscringTopicName (can_msgs/Frame)
Published Topic: /inboundPublisherTopicName (package_name_msgs/PackageMessageName)

ROS to CAN Subscribed Topic: /outboundSubscribingTopicName (package_name_msgs/PachageMessageName)
Published Topic: /outboundPublishingTopicName (can_mags/Frame)

Usage

Program takes 6 parameters,
package name = Name of the package will be created in the given WS path
dbc path = path for dbc file containing .dbc file
package path = Path for WS/src
filter file path = Path of the filter file.
subscribing topic name = Topic for inbound can data (can_msgs/Frame)
publisher topic name = Topic for outbound can data (can_msgs/Frame)

python3 canparsercreator.py <package name> <dbc path> <package path> <filter file path> <subscribing topic name for can messages> <publishing topic name for can messages>

Notes

If a signal name in the header file does not match with the signal name in the DBC, program prints <signal_name> did not find in the DBC to standart output.

About


Languages

Language:Python 88.7%Language:Shell 11.3%