Skip to content

Rospy controllers

The rospy_controllers package implements a Python ROS node that can be used to implement controllers for CRS in Python. It mimics the structure of ros_controllers with a few differences.

  • All Python files are stored in the same folder (e.g. for the visualizer, solver generation, controller).
  • Control inputs and visualization are managed by the Python controller.

Usage

  1. Set control_package:=rospy_controllers in the CRS launch file (e.g. in sim_single_car.launch).
  2. Set controller_type in the controller configuration such that it is correctly resolved in __init__.py.
  3. Launch!

Implemented controllers

Zero-order GP-MPC

The documentation for the zero-order GP-MPC controllers can be found here.

Development

Adding a new Python controller

To add a new Python controller,

  1. Add another Python module (directory with __init__.py) in the rospy_controllers directory.
  2. Decide on a controller_type for your Python controller and resolve it in the __init__.py file. Set the same controller_type in your controller config, see, e.g., this example config.
  3. Implement your controller as a subclass of the abstract RosPyController class defined in rospy_controller.py. In particular, it needs to return a control input when calling get_input(state); visualization is performed by publishing messages with publish_visualization(); both methods are called at every controller sampling time.