Enabling robots to learn from few demonstrations is a crucial step toward task automation. This paper addresses a key challenge in robotic learning from demonstration: developing adaptable, constraint-aware systems that learn from a limited number of demonstrations, infer task-specific geometrical constraints autonomously, and ensure trajectory adherence to these constraints while remaining accessible to non-expert users. The proposed methodology integrates automatic task-constraint extraction from teleoperated demonstrations with a novel sigmoidal coupling term (SIG-CDMP) to enforce spatial constraints within Dynamic Movement Primitives (DMPs). By analyzing variability in demonstrations, the framework defines a tolerance zone for robot motion and ensures that generated trajectories remain within these bounds, even when adapting to new initial or goal positions. The efficacy of this approach is validated in two real-world industrial applications—sterility testing in pharmaceutical industry and cable wiring in electric vehicle batteries—demonstrating negligible increases in computational cost and smooth, constraint-compliant trajectories. By integrating task-constraint extraction and enforcement, this approach advances the development of constraint-aware robotic systems that learn from repeated demonstrations to teach control policies respecting inferred geometrical constraints, paving the way for safe and reliable task automation in complex environments.
Generating robot behaviors in dynamic real-world situations generally requires the programming of multiple, often redundant degrees of freedom to meet multiple goals governing the desired motions. In this work, we propose a constraint-based controller specification methodology. A novel declarative language is used to combine semantically specialized building blocks into composite controllers. This description is automatically transformed at runtime into an executable form, which can automatically leverage multiple threads to parallelize computations whenever possible. Enabling runtime definition of controller topologies out of declarative descriptions not only reduces the work required to develop such controllers, but it also allows one to dynamically synthesize new controllers based on higher-level task planners or by user interaction through Graphical User Interfaces (GUIs). Our solution adds new functionality to the Robot Operating System (ROS)/ros_control ecosystem, where robot behaviors are typically achieved by deploying single-objective, off-the-shelf controllers for tasks like following joint trajectories, executing interpolated point-to-point motions in Cartesian space, or for basic compliant behaviors. Our proposed constraint-based framework enhances ros_control by providing the means to easily construct composite controllers from existing primary elements using our design language. Building on top of the ros_control infrastructure facilitates the usage of our controller with a wide range of supported robots and enables quick integration with the existing ROS ecosystem.