mirror of
https://github.com/soconnor0919/honors-thesis.git
synced 2026-05-08 07:08:55 -04:00
post-defense revisions complete
This commit is contained in:
@@ -7,11 +7,81 @@ HRIStudio is a complete, operational platform that realizes the design principle
|
||||
|
||||
HRIStudio follows the model of a web application. Users access it through a standard browser without installing specialized software, and the entire study team, including researchers, wizards, and observers, connect to the same shared system. This eliminates the need for a local installation and ensures the platform works identically on any operating system, directly addressing the low-technical-barrier requirement (R2, from Chapter~\ref{ch:background}). It also enables easy collaboration (R6): multiple team members can access experiment data and observe trials simultaneously from different machines without any additional configuration.
|
||||
|
||||
I organized the system into three layers: User Interface, Application Logic, and Data \& Robot Control. This layered structure is presented in Chapter~\ref{ch:design} and shown in Figure~\ref{fig:three-tier}. In practice, the User Interface layer runs in each researcher's browser (the client), while the Application Logic and Data \& Robot Control layers run on a shared application server. It is essential that this server and the robot control hardware run on the same local network. This keeps communication latency low during trials: a noticeable delay between the wizard's input and the robot's response would break the interaction.
|
||||
I organized the system into three layers: User Interface, Application Logic, and Data \& Robot Control. This layered structure is presented in Chapter~\ref{ch:design} and shown in Figure~\ref{fig:three-tier}. In practice, the User Interface layer runs in each researcher's browser (the client), while the Application Logic and Data \& Robot Control layers run on a shared application server.
|
||||
|
||||
While the system can run entirely on a single machine for local testing, this architecture allows the components to be distributed across different systems. The application server can be hosted centrally or even in a remote data center, enabling observers to connect to a live trial from any location with internet access. In such a configuration, it is essential that the robot control hardware and the client computer running the wizard's Execution interface stay on the same local network as the robot. This ensures that the WebSocket-based communication between the wizard and the robot bridge maintains low latency, as a noticeable delay between the wizard's input and the robot's response would break the interaction.
|
||||
|
||||
This flexibility of deployment also addresses the varying data security and compliance needs of different research institutions. A lab may choose to host HRIStudio on a public-facing server to prioritize collaborative ease and accessibility for remote team members. Alternatively, a lab with strict data privacy requirements or institutional review board (IRB) constraints can deploy the entire stack on a private, air-gapped network. Because the platform is self-contained and does not rely on external cloud services for its core execution logic, researchers have full control over where their experimental data is stored and who can access it.
|
||||
|
||||
I implemented all three layers in the same language: TypeScript~\cite{TypeScript2014}, a statically-typed superset of JavaScript. The single-language decision keeps the type system consistent across the full stack. When the structure of experiment data changes, the type checker surfaces inconsistencies across the entire codebase at compile time rather than allowing them to appear as runtime failures during a trial.
|
||||
|
||||
HRIStudio is released as open-source software under the MIT License, with the application hosted at a public repository~\cite{HRIStudioRepo} and the companion robot plugin repository hosted separately~\cite{RobotPluginsRepo}. Both are available for inspection, extension, and deployment by other research groups.
|
||||
HRIStudio is released as open-source software under the MIT License, with the application hosted at a public repository~\cite{HRIStudioRepo}. The companion robot plugin repository~\cite{RobotPluginsRepo} is maintained as a git submodule and is updated whenever HRIStudio requires schema or protocol updates. Both repositories are available for inspection, extension, and deployment by other research groups.
|
||||
|
||||
HRIStudio is implemented as a set of containerized services that work together to provide the platform's functionality. This modular architecture ensures that each component can be scaled or replaced independently as requirements change.
|
||||
|
||||
\begin{figure}[htbp]
|
||||
\centering
|
||||
\begin{tikzpicture}[
|
||||
node distance=0.8cm and 1.8cm,
|
||||
servicebox/.style={rectangle, draw=black, thick, fill=gray!15, align=center, font=\small, inner sep=5pt, minimum width=2.2cm},
|
||||
containerbox/.style={rectangle, draw=black, thick, dashed, fill=gray!5, align=center, font=\small\bfseries, inner sep=12pt},
|
||||
wsbox/.style={rectangle, draw=black, ultra thick, fill=white, align=center, font=\scriptsize\bfseries, inner sep=3pt},
|
||||
arrow/.style={->, thick, >=stealth},
|
||||
darrow/.style={<->, thick, >=stealth, dashed},
|
||||
labelstyle/.style={font=\scriptsize\itshape, align=center}
|
||||
]
|
||||
|
||||
% HRIStudio System Container Services
|
||||
\node[servicebox] (nextjs) {Next.js\\Server};
|
||||
\node[servicebox, below=of nextjs] (postgres) {PostgreSQL\\Database};
|
||||
\node[servicebox, below=of postgres] (minio) {MinIO\\Object Storage};
|
||||
\draw[arrow] (nextjs) -- (postgres);
|
||||
\draw[arrow] (nextjs) -- (minio);
|
||||
|
||||
% HRIStudio Container Boundary
|
||||
\begin{scope}[on background layer]
|
||||
\node[containerbox, fit=(nextjs) (postgres) (minio), inner sep=15pt] (hri_cont) {};
|
||||
\node[anchor=south, font=\small\bfseries, yshift=2pt] at (hri_cont.north) {HRIStudio System};
|
||||
\end{scope}
|
||||
|
||||
% NAO6 Integration Bridge Container Services
|
||||
\node[servicebox, right=4.5cm of nextjs] (driver) {NAOqi\\Driver};
|
||||
\node[servicebox, below=of driver] (ros) {ROS 2\\Core};
|
||||
\node[servicebox, below=of ros] (adapter) {HRIStudio\\Adapter};
|
||||
\draw[darrow] (driver) -- (ros);
|
||||
\draw[darrow] (ros) -- (adapter);
|
||||
|
||||
% Bridge Container Boundary
|
||||
\begin{scope}[on background layer]
|
||||
\node[containerbox, fit=(driver) (ros) (adapter), inner sep=15pt] (bridge_cont) {};
|
||||
\node[anchor=south, font=\small\bfseries, yshift=2pt] at (bridge_cont.north) {NAO6 Bridge};
|
||||
\end{scope}
|
||||
|
||||
% Client/Wizard
|
||||
\node[servicebox] (client) at ($(hri_cont.north)!0.5!(bridge_cont.north) + (0, 2.2)$) {Wizard Browser};
|
||||
|
||||
% WebSocket Connections
|
||||
\node[wsbox] (sys_ws) at ($(client.south)!0.5!(hri_cont.north)$) {System WebSocket};
|
||||
\node[wsbox] (robot_ws) at ($(client.south)!0.5!(bridge_cont.north)$) {Robot WebSocket};
|
||||
|
||||
\draw[darrow] (client.south) -- (sys_ws.north);
|
||||
\draw[darrow] (sys_ws.south) -- (hri_cont.north);
|
||||
|
||||
\draw[darrow] (client.south) -- (robot_ws.north);
|
||||
\draw[darrow] (robot_ws.south) -- (bridge_cont.north);
|
||||
|
||||
% Hardware
|
||||
\node[servicebox, right=1.5cm of bridge_cont] (robot) {NAO6\\Robot};
|
||||
\draw[arrow] (bridge_cont.east) -- node[above, font=\scriptsize, align=center] {NAOqi\\API} (robot.west);
|
||||
|
||||
\end{tikzpicture}
|
||||
\caption{The containerized architecture of HRIStudio and the NAO6 integration bridge. The wizard's browser maintains two independent WebSocket connections: one for system state and logging, and one for direct robot control.}
|
||||
\label{fig:system-architecture}
|
||||
\end{figure}
|
||||
|
||||
The HRIStudio system consists of three primary services: a Next.js application server that handles the user interface and business logic, a PostgreSQL database for persistent storage of experiment and trial data, and a MinIO object storage service for managing large media files like video and audio recordings. For robot integration, the \texttt{nao6-hristudio-integration} bridge also employs a containerized structure consisting of the NAOqi driver, a ROS 2 core for message routing, and a specialized adapter that communicates with HRIStudio.
|
||||
|
||||
During a live trial, the wizard's browser establishes two independent WebSocket connections. The System WebSocket connects to the HRIStudio server to manage trial state, protocol progression, and logging. The Robot WebSocket connects directly to the integration bridge to provide low-latency control of the robot platform. This split-connection model ensures that system-level management does not introduce latency into the robot's physical responses.
|
||||
|
||||
\subsection{Working with AI Coding Assistants}
|
||||
\label{sec:ai-ws}
|
||||
@@ -126,7 +196,7 @@ Figure~\ref{fig:execution-view} shows the Execution interface as it appears to a
|
||||
|
||||
\section{Robot Integration}
|
||||
|
||||
A plugin file describes each robot platform, listing the actions it supports and specifying how each one maps to a command the robot understands. The execution engine reads this file at startup and uses it whenever it needs to dispatch a command: it looks up the action type, assembles the appropriate message, and sends it to the robot over a bridge process running on the local network. The web server itself has no knowledge of any specific robot; all hardware-specific logic lives in the plugin file.
|
||||
A plugin file describes each robot platform, listing the actions it supports and specifying how each one maps to a command the robot understands. The execution engine reads this file at startup and uses it whenever it needs to dispatch a command: it looks up the action type, assembles the appropriate message, and sends it to the robot over a bridge process running on the local network. For the NAO6 platform, I developed a specialized ROS-based bridge called \texttt{nao6-hristudio-integration}~\cite{NaoIntegrationRepo} that translates HRIStudio commands into the NAOqi API calls required by the robot. The web server itself has no knowledge of any specific robot; all hardware-specific logic lives in the plugin file.
|
||||
|
||||
The execution engine treats control flow elements such as branches and conditionals, which function as elements of a computer program, the same way as robot actions. These control-flow elements appear as action groups in the experiment and are evaluated during the trial, so researchers can freely mix logical decisions and physical robot behaviors when designing an experiment without any special handling.
|
||||
|
||||
@@ -177,6 +247,10 @@ Figure~\ref{fig:plugin-architecture} illustrates this mapping using NAO6 and Tur
|
||||
\label{fig:plugin-architecture}
|
||||
\end{figure}
|
||||
|
||||
\subsection{Containerized Development Environment}
|
||||
|
||||
To support development and testing for the NAO platform, I also developed \texttt{nao-workspace}, a containerized workspace~\cite{NaoWorkspaceRepo}. This was motivated by the technical constraints of Choregraphe and its related libraries, which only supported x86-64 systems running Ubuntu 22.04. The containerized structure was the only way I could run the proprietary NAO development tools on modern hardware. While I developed this stack primarily to enable technical testing and material preparation during the project, the resulting tooling may be useful to other HRI researchers facing similar platform constraints.
|
||||
|
||||
\section{Access Control}
|
||||
|
||||
I implemented access control using a role-based access control (RBAC) model with two layers. System-level roles govern what a user can do across the platform (administrator, researcher, wizard, observer), while study-level roles govern what a user can see and do within a specific study (owner, researcher, wizard, observer). The two layers are checked independently, so a user who is a wizard on one study can be an observer on another without any additional configuration. Within a study, the four study-level roles define a clear separation of capabilities: those who own the study, those who design it, those who run it, and those who observe it. This enforces need-to-know access at the study level so that each team member sees or is able to modify only what their role requires. The capabilities and constraints for each role are described below:
|
||||
|
||||
Reference in New Issue
Block a user