This repository contains:
- ROS2 trajcontrol package (see nodes and message exchanges in Communication Diagram)
- Launch files for different control tasks for Lisa robot (see details in Usage)
/needle/state/current_shape: "geometry_msgs/msg/PoseArray" - the pose array of the needle shape in 0.5 mm increments
stage/state/pose: "geometry_msgs/msg/PoseStamped - pose of the robot
/stage/state/needle_pose: "geometry_msgs/msg/PoseStamped - current absolute insertion depth (x=0.0, y=abs(depth), z=0.0, q=[1,0,0,0])
/move_stage: "stage_control_interfaces/action/MoveStage" - action for moving the robot to given horizontal (x) and vertical (z) positions
Create a workspace and to the src folder, commit the following repositories:
- trajcontrol
- ros2_needle_guide_robot
- ros2_needle_shape_publisher
- ros2_hyperion_interrogator
- ros2_igtl_bridge
Remember to install OpenIGTLink
To build system packages:
colcon build --cmake-args -DOpenIGTLink_DIR:PATH=<insert_path_to_openigtlink>/OpenIGTLink-build --symlink-install
To run in debug mode, include:
--ros-args --log-level debug
The trajcontrol demo emulates the needle insertion and robot motion using the keyboard. Open 2 terminals:
- Launch trajcontrol demo:
ros2 run trajcontrol trajcontrol_demo
- Run keyboard node:
ros2 run trajcontrol keypress
and use the keyboard to signal an insertion step. SPACE key emulates a 5mm insertion step without robot motion, while arrows from the numeric keyboard (2,4,6,8) emulate a 5mm insertion step with 1mm displacement of the robot in the corresponding up-down/left-right directions.
To be defined
To be defined
You may want to manually position the robot (in horizontal and vertical directions) using the keyboard.
To use robot in manual mode, open 3 terminals:
- Launch PlusServer with configFile 'PlusDeviceSet_Server_NDIAurora_1Needle.xml'
sudo /opt/PlusBuild-bin/bin/./PlusServerLauncher
- Launch robot in manual:
ros2 launch trajcontrol manual.launch.py
- Run keyboard node:
ros2 run trajcontrol keypress
and use arrows from the numeric keyboard (2,4,6,8) to move robot up-down/left-right No experimental data is recorded.
You may need to move the robot to a pre-defined sequence of positions (waits 3.0s at each position before automatically moving to the next one)
To use robot in sequence mode, open 2 terminals:
- Launch PlusServer with configFile 'PlusDeviceSet_Server_NDIAurora_1Needle.xml'
sudo /opt/PlusBuild-bin/bin/./PlusServerLauncher
- Launch robot in manual:
ros2 launch trajcontrol sequence.launch.py filename:=NAME
Defining filename (default=my_data) is optional. The file defined by 'filename' is a csv with all experimental data and is it saved as 'data/NAME.csv'
You may need to position the robot at a pre-defined X (horizontal) position with Z (vertical) in manual mode. This is useful to perform the insertions at the same position with respect to the Aurora (and avoid parts of the measuring volume that are problematic).
To move robot to a fixed X, open 3 terminals:
- Launch PlusServer with configFile 'PlusDeviceSet_Server_NDIAurora_1Needle.xml'
sudo /opt/PlusBuild-bin/bin/./PlusServerLauncher
- Launch robot in manual:
ros2 launch trajcontrol init.launch.py
- Run keyboard node:
ros2 run trajcontrol keypress
and use arrows from the numeric keyboard (2,8) to move robot up-down No experimental data is recorded.
To run the trajectory control with MPC, open 3 terminals:
- Launch PlusServer with configFile 'PlusDeviceSet_Server_NDIAurora_1Needle.xml'
sudo /opt/PlusBuild-bin/bin/./PlusServerLauncher
- Launch robot in manual:
ros2 launch trajcontrol mpc_step.launch.py H:=4 filename:=NAME
Defining H (default=5) and filename (default=my_data) are optional.
- Run keyboard node:
ros2 run trajcontrol keypress
and use SPACE key from the keyboard to signal each insertion step. Defining H(default:=5) and filename (default=my_data) are optional. The file defined by 'filename' is a csv with all experimental data and is it saved as 'data/NAME.csv'
Launch trajectory control package (robot, needle, sensor_processing, save_file, estimator and controller nodes)
ros2 launch trajcontrol mcp_step.launch.py filename:=name_for_data_file
ros2 run trajcontrol keypress
ros2 launch trajcontrol real_test.launch.py filename:=name_for_data_file
ros2 run trajcontrol keypress