Skip to content

jackokaiser/ros_tensorflow_tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.]"