Skip to content

Latest commit

 

History

History
54 lines (45 loc) · 1.1 KB

README.md

File metadata and controls

54 lines (45 loc) · 1.1 KB

ros_tensorflow tutorial

This repo implements a Tensorflow 2 integration in ROS. Explanations are given in the following blog post.

Files

This repo contains two ROS packages:

  • ros_tensorflow
  • ros_tensorflow_msgs

Installing

  1. Install the dependencies: pip3 install -r requirements.txt
  2. Clone this repo to your catkin workspace
  3. Build the workspace: catkin_make

Running

  1. Run the node: rosrun ros_tensorflow node.py
  2. Predictions are performed at regular time interval in a loop
  3. Train the Tensorflow model (use tab completion):
rostopic pub /train/goal ros_tensorflow_msgs/TrainActionGoal "header:
  seq: 0
  stamp:
    secs: 0
    nsecs: 0
  frame_id: ''
goal_id:
  stamp:
    secs: 0
    nsecs: 0
  id: ''
goal:
  epochs: 10"
  1. Abort training (use tab completion):
rostopic pub /train/cancel actionlib_msgs/GoalID "stamp:
  secs: 0
  nsecs: 0
id: ''"
  1. Run predicitons from a service call (use tab completion):
rosservice call /predict "data: [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]"