rmango / ros_flask

Simple ROS - Flask Integration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UPDATED DOCS

Dependencies

This is a ros package, so needs to go inside of the src of a catkin workspace

remember to pip install Flask install locally this python library: https://github.com/rmango/flask-ngrok To install locally, run this inside of the flask-ngrok folder: pip install -e .

Run app

to run: roslaunch ros_flask start_server.launch also run the start message ros python file, in this repo: https://github.com/rmango/ROS-arm-cam

Running with a rosbag

In a new terminal, cd into the directory that contains your rosbag
run $ source /opt/ros/noetic/setup.bash
run $ rosbag play <rosbag_name>.bag

Testing

To test out messages, use Postman
example postman requests are in the file research.postman_collection.json

Helpful command to watch the /img_coord topic: rostopic echo /img_coords

** old docs start here **

About

Simple Flask - ROS prototype.

Alternative to using ROSLIBJS

Send motion commands via http://localhost:5000/send_movement_command/<direction>

View possible commands at http://localhost:5000/help

An in-depth tutorial is available on the ros_flask wiki

Basic Quickstart

After setting up ROS catkin and making, run this:

roslaunch flask_ros start_server.launch

For more information view the flask_ask_ros repo linked below.

Limitations

  • Flask HTML templates don't seem to work. See /src/html.py for used workaround for providing html responses. This could be an issue with how ROS manages directories. -- NOTE: I have actually fixed this on another project but am too lazy to update things here. If someone wants this create an issue and I'll update this repo

Acknowledgements

originally cloned from this repo by the 3Spheres Project: https://github.com/3SpheresRoboticsProject/flask_ask_ros

found from this article which explains why this works: https://campus-rover.gitbook.io/lab-notebook/cr-package/web-application/flask-and-ros

for use in Oregon State University's Charisma Lab: https://www.charismarobotics.com/

About

Simple ROS - Flask Integration

License:MIT License


Languages

Language:Python 53.7%Language:CMake 45.1%Language:HTML 1.3%