[Documentation] [TitleIndex] [WordIndex

Only released in EOL distros:  

lfd: cba | lfd_common

Package Summary

An implementation of the Learning from Demonstration algorithm Confidence-Based Autonomy (CBA) built for ROS.


Confidence-Based Autonomy (CBA) is a classification based Learning from Demonstration algorithm that allows the human user and robotic agent to jointly construct the training set. The agent autonomously decides when the it feels uncertain about an action policy decision and requests a demonstration from its human user. This ROS package contains the core components of the the algorithm. In addition to running the main CBA node, the following components must be implemented in a manner that suits the agent's needs:

For additional details on CBA, please refer to the following publication:

Sonia Chernova and Manuela Veloso. Interactive Policy Learning through      Confidence-Based Autonomy. Journal of Artificial Intelligence Research.      Vol. 34, 2009. PDF



The main implementation of CBA. This node listens to a state publisher and attempts to produce an action label to execute. If the agent instead feels uncertain about its decisions, a demonstration request is given.

Subscribed Topics

state_listener (lfd_common/state)

Published Topics

add_point (lfd_common/classification_point) change_point (lfd_common/classification_point) execute (std_msgs/Int32)


a_complete (lfd_common/action_complete)

Services Called

classify (lfd_common/conf_classification) demonstration (lfd_common/demonstration)


~max_data_points (integer, default: 1024) ~dist_thresh_mult (double, default: 1.5)

Launching CBA

The CBA assumes the the above topics/services are already running. Once it receives its first state via the state_listener topic, it will continuously iterate through the algorithm. To launch the node, the following commands can be used:

Since this node requires additional topics/services to be running, it may make sense to create a launch file for your application.

CBA Test Nodes

The cba package includes a set of test nodes used to test the functionality of the the CBA implementation. These nodes rely on semi-random data and a highly-simplified classifier. They are included only to serve as point of reference when implementing the nodes required to interact with the cba node.


The mock state publisher will continuously publish a random 3 dimensional state vector. The values are integers bounded in the range [0,25).

Published Topics

state_listener (lfd_common/state)


The mock agent is responsible for handling action execution and demonstration requests. These services are handled autonomously for the purposes of this test implementation.

Subscribed Topics

execute (std_msgs/Int32)


demonstration (lfd_common/demonstration)

Services Called

a_complete (lfd_common/action_complete)


The mock classifier is a highly simplified classifier. This classifier splits up the data into 5 labels based solely on the third-dimensional value of the state. The confidence value is simply the number of unique data points observed divided by the total state size. Noise is randomly added to give incorrect classifications.

Subscribed Topics

add_point (lfd_common/classification_point) change_point (lfd_common/classification_point)


classify (lfd_common/conf_classification)

Running the CBA Tests

If you would like to run the CBA test nodes, this can be done via the included cba_test.launch file. This file launches an instance of the cba, mock_agent, mock_classify, and mock_state_publisher nodes. To launch these nodes, the following commands can be used:


To install the lfd stack, you can choose to either install from source, or from the Ubuntu package:


To install from source, execute the following:

Ubuntu Package

To install the Ubuntu package, execute the following:


Please send bug reports to the GitHub Issue Tracker. Feel free to contact me at any point with questions and comments.



2020-03-28 12:30