Manuscript Offprint
arXiv:2611.12306ExoStack: A Modular and Reconfigurable Software Framework for Wearable Robotics Using ROS 2
Debadrata Sarkar, Upamanyu Ray, Soumen Sen, and Aman Arora
Code repository: github.com/debadrata/ExoStack
Documentation website: debadrata.github.io/ExoStack_documentation
Abstract—Wearable robots depend on a software chain that links body-worn sensing to gait interpretation, assistance generation, and actuation. Personalization further requires each measured response to remain associated with the assistance parameters that generated it. This paper presents ExoStack, a modular ROS 2 framework for implementing that chain across embedded hubs and a host computer. Its Embedded Sensing and Actuation (ESA) library configures ESP32 boards as micro-ROS sensing and actuation hubs. ExoCore supplies multi-hub synchronization, gait-event detection, profile generation, motion planning, cost evaluation, and human-in-the-loop (HIL) optimization as configuration-instantiated nodes. The PASE desktop application edits configurations, launches the processing stages, and visualizes ROS 2 topics. Hardware drivers and algorithm plugins can be added through defined interfaces without modifying the generic processing nodes. We characterize hub and planner timing on three embedded computers and demonstrate reuse on two pneumatic exosuits.
Index Terms—Wearable robots, exosuits, software framework, ROS 2, micro-ROS, human-in-the-loop optimization, modular software, reconfigurable software.
I. INTRODUCTION
W EARABLE assistive robots are progressing from laboratory demonstrations toward daily and clinical use [1], [2]. A central challenge is to deliver assistance that responds to the wearer rather than to a fixed gait template [3], [4]. Human-in-the-loop (HIL) optimization provides a systematic route to personalization: an optimizer proposes assistance parameters, the robot applies them during walking, and a cost measured on the wearer informs the next proposal [5]–[10].
Implementing this loop requires coordinated functions beyond the joint controller itself. Sensor streams from multiple body-worn boards must be acquired and aligned. Gait events must trigger the appropriate assistance profile, and the measured cost must be assigned to the candidate and gait cycles under evaluation. In many research systems, these functions evolve as part of a device-specific application. A change in sensor layout, assisted joint, actuator, or optimization strategy can then propagate through acquisition, control, and visualization code, making reuse and reproducibility difficult.
This work was supported by the CSIR-National Laboratory Scheme under ULIP [MLP002613] and the CSIR Mission Mode Project [NCP010303].
This work involved human subjects. Approval of all ethical and experimental procedures was granted by the 7th sitting of the Institutional Ethical Board of CSIR-CMERI, Durgapur, India, on 27 February 2024.
The authors are with the Human Centred Robotics and Cybernetics Group, CSIR-Central Mechanical Engineering Research Institute (CSIR-CMERI), Durgapur 713209, India. Corresponding author: Aman Arora (e-mail: aman.cmeri@nic.in).
Existing platforms address important parts of wearable-robot development. OpenExo [11] provides a modular exoskeleton hardware and control platform, whereas Epically Powerful [12] offers a Python infrastructure for quasi-direct-drive actuators, sensing, and visualization. Their design choices reflect their target hardware and control workflows. ExoStack addresses a complementary need: a configurable pipeline for systems in which sensors and actuators are distributed across several body-worn microcontrollers and host-side algorithms may change between experiments. ROS2 [13] supplies the host-side communication model, while micro-ROS [17] extends ROS2 communication to resource-constrained boards. Mature ROS2 frameworks such as Nav2 [14], MoveIt [15], and ros_control [16] demonstrate the value of separating reusable infrastructure from robot-specific configuration. ExoStack applies this principle to the sensing-to-assistance workflow of wearable robotics.
To the best of our knowledge, ExoStack is the first ROS 2 framework to cover the complete wearable-robot pipeline, from body-worn sensing to personalized assistance. Its contributions are: (1) a firmware API for distributed, multi-hub sensing and actuation, publishing analog, digital, and I²C readings on a shared time base without hand-written micro-ROS code; (2) configurable ROS 2 nodes for gait-event detection, motion planning, and assistance deployment or optimization, instantiated per limb, joint, and event; (3) a coordinated HIL loop linking each optimizer candidate to its execution and cost measured over its gait cycles, preventing cost misattribution; (4) a unified profile framework routing speed- and intent-indexed lookup tables and HIL candidates through the same planners; (5) template-guided extensibility through self-registering drivers and plug-in algorithms; and (6) a graphical tool to configure, launch, and visualize the stack. Timing benchmarks and two pneumatic-exosuit implementations validate the framework.
This work has been submitted to the IEEE for possible publication.
Copyright may be transferred without notice, after which this version may no longer be accessible.

Fig. 1. System overview. ESA hubs exchange sensor data and set-points with ExoCore through micro-ROS. PASE configures and launches the graph and visualizes topics. YAML entries determine the hub, driver, detector, planner, profile, cost, and HIL instances.
channel order, event detectors, planners, and profile sources. Launch files create node instances from these entries. Device drivers are resolved through the ESA registries, and ExoCore algorithms are loaded from plug-in directories. PASE edits the YAML files, starts the agents and processing stages, and visualizes topic data. External ROS 2 estimators and actuator drivers can connect through the published topic interfaces.
III. EMBEDDED SENSING AND ACTUATION (ESA)
A. Declaring a Hub
ESA is an Arduino library that turns an ESP32 board into a sensing hub, an actuation hub, or both. The sketch declares sensors in deviceList[] using an interface type (AI, DI, or I2C), a GPIO pin or bus address, a channel label, and type-specific settings. These settings select analog filtering, digital input mode, or the I²C bus and device parameters (Sup. Table S1). The initialization sequence is explicit. setupCommunication() selects Wi-Fi or USB, initializeSystem() initializes the declared devices, and setupNode() assigns the ROS node name. setupPublisher() and setupActuation() declare the data and command interfaces. Finally, bootSystem() creates the micro-ROS entities and starts the 3-s watchdog (Fig. 2).
B. Sensing and Actuation
At run time, readSensorsData() reads the declared inputs. Analog channels support moving-average, median, exponential, and second-order Butterworth low-pass, high-pass, band-pass, and notch filters. Digital channels support
normal, pull-down, and pull-up modes. I²C acquisition is delegated to the registered device drivers. Values are serialized in declaration order into sensor_msgs/LaserScan.intensities[] and published by a micro-ROS timer at the configured rate. Reusing a standard message type avoids maintaining a custom micro-ROS interface. An actuation hub subscribes to one Float32 command topic per actuator and passes the latest set-point to the corresponding driver through actuate(). The sensing and actuation loops service the micro-ROS executor with a bounded 10-ms spin, allowing timers and command callbacks to be handled alongside the application loop.
When reconnection monitoring is requested, publish(true) also pings the agent and recreates the ROS entities after a lost connection. The watchdog resets a stalled application loop, while a status LED indicates ROS entity-creation failures. Filter type and parameters are selected per analog channel, and the filter coefficients are initialized using the publication rate. This keeps device-specific acquisition settings in the sketch rather than in the host-side processing code.
C. Extending the Driver Registry
Hardware-specific code is kept in paired header and source driver files. An I²C sensor driver uses REGISTER_I2C_SENSOR to register initialization and read callbacks. ESA resolves the callback by bus and address during initialization. Actuator drivers use REGISTER_ACTUATOR to register initialization and command callbacks for an ActuatorType. The sketch then binds an actuator instance to a command topic and its hardware pins or address using setupActuation(topic, type, output, extra1, extra2). The supplied interfaces cover the BNO085 IMU, NAU7802 load-cell amplifier, AS5600 magnetic encoder, Festo VEAB-L-26 pressure regulator, and SG90 servo. New hardware can be added through the same registries, or exposed through an independent ROS 2 driver when embedded integration is unnecessary.
D. Synchronizing the Hubs
The synchronizer periodically broadcasts /sync_trigger while establishing a set of active hubs. Each hub records the

Fig. 2. ESA hub sequence. Drivers register before setup. Setup initializes communication, devices, the ROS node, publishers, and actuators. The runtime loop publishes sensor channels in msg.intensities[] and applies actuator commands while the executor services timers and callbacks.

Fig. 3. ExoCore, the generic ROS 2 nodes, and their topics. ×E, ×P, ×C, and ×H count the instances created from YAML entries. Solid arrows carry ROS data, dotted arrows optional inputs, the dash-dotted loop the physical feedback through the wearer, and dashed arrows what is loaded at start. The candidate number k travels in the profile, status, and cost messages, so the optimizer accepts only the cost of the candidate it proposed.
local millis() value when the trigger arrives and stamps subsequent messages with elapsed time from that event. These trigger-relative stamps place the hub streams on a comparable time base without synchronizing their local clocks. The host matches incoming messages within a configurable timestamp tolerance and monitors the stream for loss of synchronization (Sec. IV-A).
IV. ExoCORE
ExoCore is the host-side ROS 2 Python package (Fig. 3). The implementation targets Ubuntu 22.04 and ROS 2 Humble, with Python 3.10 on the host and the Humble micro-ROS client on ESP32 boards. It comprises six executables: sync, gait_event_detector, mplanner, actuation_profile, cost, and hil. Launch files instantiate detector, planner, profile, cost, and optimizer nodes from entries in sensors.yaml, gait_events.yaml, mplanner.yaml, and profile.yaml. The configuration therefore determines both the number of node instances and the signals and topics that connect them. For example, separate flexion-and extension-onset events for each hip create four detector instances, while each assisted motion receives its own planner and profile node. Cost and HIL nodes are created only for profiles that enable those functions. The ROS 2 topic names, message types, and array layouts are documented in Sup. Table S3.

Fig. 4. Planner target-rate attainment and end-to-end latency on the three host computers. Values are mean ± SD.
A. Synchronization and Gait Events
The synchronizer publishes /sync_trigger at 5 Hz while it is in trigger mode. It subscribes to the configured hub topics using an approximate-time synchronizer with a user-defined slop_time. Once a matched set is received, it concatenates the LaserIntensities[] arrays in the hub and channel order specified by sensors.yaml and publishes the result as Float32MultiArray on /synced_sensors. If no matched set arrives for 1 s, the node returns to trigger mode and resets its synchronizer. The associated SensorUtil maps each hub-channel pair to its position in the concatenated array, so algorithms refer to named signals rather than hard-coded indices.
Each gait-event node selects its configured channels from /synced_sensors, passes them to a dynamically loaded detect() plug-in, and publishes an Int32 event when the detector fires. The supplied plug-ins include a thresholded rising-edge detector for foot-pressure signals (HeelStrike) and positive-to-negative or negative-to-positive zero-crossing detectors for angular signals. Each detector maintains a sliding window of N samples and requires a configurable fraction F of consecutive samples at the end of the window to support the new state. After an event, it rearms only when the window has returned fully to the opposite state (Sup. Fig. S1a).
B. Motion Planning and Assistance-Profile Generation
Each assisted motion uses a profile node and planner to convert gait events and wearer state into actuator set-points. In Deployment, a JSON lookup table supplies parameters indexed by walking speed and, optionally, locomotion intent. A lookup plug-in selects the nearest speed entry or interpolates between entries, and a builder converts the parameters into time-value waypoints or function coefficients. In HIL, the same builder encodes optimizer candidates. Profiles are published as Float32MultiArray messages with a common layout comprising candidate identifier k (zero in Deployment), type, start, payload, end, and stop flag. The type distinguishes waypoint and coefficient representations, while the payload contains the corresponding values (Sup. Fig. S1b; Sup. Sec. 2.2).

Fig. 5. Validation on (a) the bilateral knee-flexion exosuit SoftEXOwalk, (b) its Bayesian HIL optimization, and (c) the resulting profiles and transmitted forces, and (d) the hip flexion/extension exosuit with (e) example CMA-ES-tuned assistance profiles.
The planner evaluates the profile at its configured rate using time since the triggering gait event (time_based) or externally estimated gait phase (gait_phase_based). Incoming profiles are buffered until the next gait event. Outside the profile interval, or when an intent value of zero raises the emergency-stop flag, it publishes default_output. Manual mode adds an offset to default_output. The supplied working planner uses linear interpolation; PCHIP is a separate, smoother, non-overshooting alternative, but is documented as non-operational in v1.0 [19] (Sup. Fig. S1c).
C. Human-in-the-Loop Optimization
HIL optimization evaluates one candidate at a time (Fig. 3). The optimizer publishes a parameter vector with identifier k. The profile node builds it, and the planner activates it at the next gait event. At each subsequent event, the planner reports k and the cycle count. The cost node discards the configured adaptation cycles, evaluates its plug-in over the next specified cycles, and returns the mean cost with the same identifier. The optimizer accepts only the outstanding candidate's result, preventing delayed feedback from being assigned to a later proposal. Cost plug-ins can use synchronized channels and external signals such as metabolic or EMG measurements. ExoStack includes CMA-ES (OPT_CMA_ES) [20], [21] and Bayesian optimization (OPT_BAYESIAN) [22]. Candidate parameters and costs are saved as CSV.
V. PASE: CONFIGURE, LAUNCH, AND VISUALIZE
PASE is a PyQt5 desktop application with three linked functions. The Configuration tab edits the four YAML files and populates algorithm selectors from the available plug-in directories. The Launch tab starts the micro-ROS agents and ExoCore stages in dependency order and reports which configured nodes are active. The Visualization tab provides live plots of selected ROS 2 topic fields, allows channels to be selected by their configured names, and overlays gait events on sensor traces. Plot arrangements can be saved and restored, supporting repeatable inspection during setup and experiments.
VI. VALIDATION AND BENCHMARKING
Validation on two exosuits: ExoStack was evaluated on two CSIR-CMERI pneumatic exosuits (Fig. 5, Sup. Sec. 4), both using silicone-tube artificial muscles (pSTAMs), proportional
pressure regulators, and the same ESA library and ExoCore executables. Only device lists, YAML configurations, and plug-ins differed. SoftEXOwalk [18] provides bilateral knee-flexion assistance. Each leg used a USB sensing hub with an insole FSR, two BNO085 IMUs, a load cell, and a pSTAM strain sensor, and an actuation hub with a regulator and pressure feedback. FSR heel strikes triggered time-based planners, while Bayesian HIL tuned the amplitude and onset delay of a trapezoidal profile. Its cost plug-in estimated knee angle as , segmented force data at minimum knee angle, rewarded peak assistive force, and penalized peak resistive force above 15 N.
The second system assisted bilateral hip flexion and extension using four backpack-mounted pSTAMs coupled to the thighs through tendons and a speed-enhancement mechanism. Two wireless thigh hubs acquired insole-pressure, IMU, and load-cell signals. Two USB backpack hubs acquired encoder, muscle-strain, and regulator-pressure signals, while two USB actuation hubs controlled the regulators and exhaust valves. Opposite-polarity zero crossings of thigh angular velocity detected terminal flexion and extension. Four time-based planners generated bilateral commands, with CMA-ES optimizing onset delay, rise, hold, and fall times to maximize the peak assistive-to-resistive force ratio, subject to a 15 N peak-resistive-force limit. Both systems operated sensing and actuation at 100 Hz. Deployment profiles were indexed by leg, assisted motion, and walking speed from 3.5 to 5.5 km/h in 0.5-km/h increments.
Benchmarking: Tests on ROS 2 Humble using a Jetson AGX Orin, Jetson Orin Nano, and LattePanda Delta confirmed stable distributed sensing, with eight hubs publishing at 100 Hz at a measured rate of Hz. End-to-end tests further showed that all three hosts reliably support 200–300 Hz planning, maintaining at least 97% of the target rate with latency below 18 ms. Performance becomes hardware-dependent at higher rates (Fig. 4). The full benchmark protocol is provided in Sup. Sec. 3.
Conclusion: ExoStack links distributed sensing, gait-event assistance, and HIL personalization through configurable ROS 2 nodes. Reuse across two pneumatic exosuits and timing tests on three embedded hosts demonstrate its practical value.
DESCRIPTION OF SUPPLEMENTARY MATERIAL
users add their own drivers and plug-ins (no core file is edited); § = section of this manual

Fig. 6. Repository layout of ExoStack. Each module is copied to the folder shown under its name. Dashed entries mark locations where users add their own drivers and plug-ins, with labels pointing to the relevant section of the supplementary document.
The supplementary material provides the source code and a companion document that serves as the user manual (Table I). The documentation website, https://debadrata.github.io/ExoStack_documentation/, provides configuration references, PASE screenshots, and videos of both exosuits. The code and documentation are available from the public repository https://github.com/debadrata/ExoStack. Its directory structure is shown in Fig. 6. The software is distributed under the PolyForm Noncommercial License 1.0.0, and the manual under CC BY-NC 4.0.
Each module is installed where it runs. ESA is an Arduino library on the computer that programs the hubs, ExoCore is the ROS2 package exo_stack in a colcon workspace on the host computer, exo_stack_resources resides in the user's home directory, and PASE is a stand-alone Python application. The supplementary document follows the order in which a new user brings up a device: installation, hub firmware, node configuration, operation through PASE, and extension through templates. It also documents the benchmarking set-up and results (§3) and the hardware, sensing, actuation, and control configurations used for both exosuit validations in Sec. VI.
TABLE I CONTENTS OF THE SUPPLEMENTARY MATERIAL
| Item | Content |
|---|---|
| Code (PolyForm Noncommercial License 1.0.0)ESA/ Arduino library for ESP32 hubs: API, drivers, driver templates, example sketches | |
| exo_stack/ | ExoCore ROS 2 package: six nodes and their launch files |
| exo_stack_resources/ | YAML files, plug-ins and plug-in templates, lookup tables, HIL logs |
| PASE_GUI/ | configuration, launch, and visualization tool |
| Supplementary document (PDF, CC BY-NC 4.0) | |
| §1 | repository layout (Fig. 6) |
| §2.1 | installation of ESA, the micro-ROS agent, ExoCore, and PASE |
| §2.2 | configuration: hub sketches with the device list (Table S1) and driver registries (Table S2), YAML files, lookup tables, detection and profile examples (Fig. S1) |
| §2.3–2.4 | running the stack, including PASE launch and visualization |
| §2.5–2.7 | driver and plug-in templates |
| §3 | benchmarking set-up and results (Fig. S2) |
| §4 | configurations of the two validated exosuits |
| App. A | troubleshooting and ROS 2 interfaces (Table S3) |
REFERENCES
[1] C. Siviy, L. M. Baker, B. T. Quinlivan, F. Porciuncula, K. Swaminathan, L. N. Awad, and C. J. Walsh, “Opportunities and challenges in the development of exoskeletons for locomotor assistance,” Nat. Biomed. Eng., vol. 7, no. 4, pp. 456–472, 2023.
[2] M. Xiloyannis, R. Alicea, A.-M. Georgarakis, F. L. Haufe, P. Wolf, L. Masia, and R. Riener, “Soft robotic suits: State of the art, core technologies, and open challenges,” IEEE Trans. Robot., vol. 38, no. 3, pp. 1343–1362, 2022.
[3] D. D. Molinaro, K. L. Scherpereel, E. B. Schonhaut, G. Evangelopoulos, M. K. Shepherd, and A. J. Young, “Task-agnostic exoskeleton control via biological joint moment estimation,” Nature, vol. 635, pp. 337–344, 2024.
[4] R. L. Medrano, G. C. Thomas, C. G. Keais, E. J. Rouse, and R. D. Gregg, “Real-time gait phase and task estimation for controlling a powered ankle exoskeleton on extremely uneven terrain,” IEEE Trans. Robot., vol. 39, no. 3, pp. 2170–2182, 2023.
[5] K. L. Poggensee and S. H. Collins, “How adaptation, training, and customization contribute to benefits from exoskeleton assistance,” Sci. Robot., vol. 6, no. 58, p. eabf1078, 2021.
[6] P. Slade, M. J. Kochenderfer, S. L. Delp, and S. H. Collins, “Personalizing exoskeleton assistance while walking in the real world,” Nature, vol. 610, pp. 277–282, 2022.
[7] J. Zhang, P. Fiers, K. A. Witte, R. W. Jackson, K. L. Poggensee, C. G. Atkeson, and S. H. Collins, “Human-in-the-loop optimization of exoskeleton assistance during walking,” Science, vol. 356, no. 6344, pp. 1280–1284, 2017.
[8] Y. Ding, M. Kim, S. Kuindersma, and C. J. Walsh, “Human-in-the-loop optimization of hip assistance with a soft exosuit during walking,” Sci. Robot., vol. 3, no. 15, p. eaar5438, 2018.
[9] M. A. Díaz et al., “Human-in-the-loop optimization of wearable robotic devices to improve human–robot interaction: A systematic review,” IEEE Trans. Cybern., vol. 53, no. 12, pp. 7483–7496, 2023.
[10] P. Slade, C. Atkeson, J. M. Donelan, H. Houdijk, K. A. Ingraham, M. Kim, K. Kong, K. L. Poggensee, R. Riener, M. Steinert, J. Zhang, and S. H. Collins, “On human-in-the-loop optimization of human–robot interaction,” Nature, vol. 633, pp. 779–788, 2024.
[11] J. R. Williams, C. F. Cuddeback, S. Fang, D. Colley, N. Enlow, P. Cox, P. Pridham, and Z. F. Lerner, “OpenExo: An open-source modular exoskeleton to augment human function,” Sci. Robot., vol. 10, p. eadt1591, 2025.
[12] J. K. Leestma, S. R. Nathella, C. P. O. Nuesslein, S. Mathur, G. S. Sawicki, and A. J. Young, “Epically Powerful: An open-source software and mechatronics infrastructure for wearable robotic systems,” arXiv:2511.05033, 2025.
[13] S. Macenski, T. Foote, B. Gerkey, C. Lalancette, and W. Woodall, “Robot Operating System 2: Design, architecture, and uses in the wild,” Sci. Robot., vol. 7, no. 66, p. eabm6074, 2022.
[14] S. Macenski, F. Martín, R. White, and J. Ginés Clavero, “The Marathon 2: A navigation system,” in Proc. IEEE/RSJ Int. Conf. Intell. Robots Syst. (IROS), 2020.
[15] D. Coleman, I. A. Şucan, S. Chitta, and N. Correll, “Reducing the barrier to entry of complex robotic software: A MoveIt! case study,” J. Softw. Eng. Robot., vol. 5, no. 1, pp. 3–16, 2014.
[16] S. Chitta et al., “ros_control: A generic and simple control framework for ROS,” J. Open Source Softw., vol. 2, no. 20, p. 456, 2017.
[17] K. Belsare et al., “Micro-ROS,” in Robot Operating System (ROS): The Complete Reference, A. Koubaa, Ed. Cham, Switzerland: Springer, 2023, vol. 7, pp. 3–55.
[18] D. Sarkar, S. Chakraborty, S. Sen, S. S. Roy, and A. Arora, “SoftEX-Owalk: A human-in-the-loop optimized soft exosuit for assisting knee flexion using sensorized pneumatic muscles,” IEEE Trans. Med. Robot. Bionics, 2026.
[19] F. N. Fritsch and R. E. Carlson, “Monotone piecewise cubic interpolation,” SIAM J. Numer. Anal., vol. 17, no. 2, pp. 238–246, 1980.
[20] N. Hansen, “The CMA evolution strategy: A tutorial,” arXiv:1604.00772, 2016.
[21] M. Nomura and M. Shibata, “cmaes: A simple yet practical Python library for CMA-ES,” arXiv:2402.01373, 2024.
[22] F. Nogueira, “Bayesian Optimization: Open source constrained global optimization tool for Python,” [Online]. Available: https://github.com/bayesian-optimization/BayesianOptimization, 2014.