Skip to content

Publisher and subscriber ROS nodes to interface with Kafka sever

License

Notifications You must be signed in to change notification settings

ethz-asl/ros-kafka-connector

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ROS Package: ros_kafka_connector

This is a ROS package for subscribing or publishing to topics using Kafka.

Takes a yaml file with {msg_type, ros_topic, kafka_topic}. Can publish the messages between ros and kafka. Put the yaml file in the config/ folder.

Example yaml file in: topics.yaml

robot_name:
    - msg_type: "std_msgs/String"
      ros_topic: "/string"
      kafka_topic: "string"
    - msg_type: "geometry_msgs/Pose"
      ros_topic: "/pose"
      kafka_topic: "pose"

Will find dictionary:

topic_dict: {
    'std_msgs/String': {'/string', 'string'},
    'geometry_msgs/Pose' : {'/pose', 'pose'}
}

Message types that are added are in the utils.py file. To add new message types to the converter, add cases to import_msg_type function. If you have custom messages from ROS, you need to make them callable in your ros workspace.

Parameter Info Default
bootstrap_server IP of kafka server "localhost:9092"
topics_filename file name of yaml "topics.yaml"
update_rate update publisher rate "10.0"
robot_name first line of yaml "UGV"

installation & running

additional libraries required:

pip install kafka-python pyyaml
sudo apt install ros-noetic-rospy-message-converter

To start publishing kafka topics to ROS:

roslaunch ros_kafka_connector ros_publisher.launch

To start publishing ROS topics to kafka:

roslaunch ros_kafka_connector kafka_publisher.launch

About

Publisher and subscriber ROS nodes to interface with Kafka sever

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.6%
  • CMake 1.4%