The section will talk about how to run the modified turtlesim demo with Aqua-Net.
The original turtlesim demo (before introducing AquaNet and changing the source code) has
the following two main components:
- turtle_teleop_key program:
Intercepts the keyboard input, wraps it into ros::twist messages and publishes them into “turtle1/cmd_vel” topic - turtlesim_node program:
Subscribes to “turtle1/cmd_vel” topic and gets the messages from it. Visualizes a movement of a “turtle” on a screen
The corresponding message flow between those components is shown on Figure 1.

The operation example of the original turtlesim package is shown on Figure 2. By pressing the arrow buttons on the keyboard where turtle_teleop_key program is executed, a user can control the movements of a turtle, visualized in the turtlesim_node program.

Now, let’s take a look at the modified version of the turtlesim package, with the introduced aquanet stack. There are 3 main components now:
- turtle_teleop_key_client program:
Intercepts the keyboard input and sends it to the aquanet socket to the other machine. - turtle_teleop_key_server program:
Receives the incoming messages from the aquanet socket, wraps them into ros::twist messages and publishes them to “turtle1/cmd_vel” topic on the receiver side. - turtlesim_node program:
This is the same program as in the original turtlesim package. It is running on the receiver side and subscribes to the messages, published by turtle_teleop_key_server program.
The corresponding message flow in the modified turtlesim + AquaNet structure is shown on Figure 3.

The operation example of the modified turtlesim + AquaNet program is shown on Figure 4. The workflow is very similar to the original turtlesim behavior, however, the only difference is that the client-machine forwards the keyboard input to the server-machine via AquaNet socket. Upon receiving the keyboard messages, the server machine wraps them back up into ros-messages, publishes them into the same “turtle1/cmd_vel” topic to be visualized by turtlesim_node locally.

Running the client side
After we enabled aqua_socket communication inside the ROS executable, we can now initialize the rest of the AquaNet stack (L1-L4) and use the turtle_teleop_key_client.cpp on L5 – the application layer of AquaNet.
To initialize the AquaNet stack from L1 to L4, do the following:
- run AquaNet Virtual Modem Server (VMDS) to emulate L1 over TCP/IP:
cd $AQUANET_FOLDER/trunk ./bin/aquanet-vmds <VMDS_PORT> &
where:
<VMDS_PORT> – port number to VMDS server, e.g. 2021
- create a bash-script inside the ROS package to start the layers for L2 to L4:
cd $ROS_FOLDER/src/ros_tutorials/turtlesim/tutorials touch vm_aloha_sroute_tra_ros.sh
- insert the following code into vm_aloha_sroute_tra_ros.sh file:
#!/bin/sh # Initialize L2-L4 modules on localhost # start the protocol stack $AQUANET_FOLDER/trunk/bin/aquanet-stack & sleep 2 # start the VMDM # modify IP and Port number, if necessary # $AQUANET_FOLDER/trunk/bin/aquanet-vmdc 127.0.0.1 2021 2 20 20 20 & $AQUANET_FOLDER/trunk/bin/aquanet-vmdc <VMDS_IP> <VMDS_PORT> 1 20 20 20 & sleep 4 # start the MAC $AQUANET_FOLDER/trunk/bin/aquanet-uwaloha & sleep 2 # start the routing protocol $AQUANET_FOLDER/trunk/bin/aquanet-sroute & sleep 2 # start the transport layer $AQUANET_FOLDER/trunk/bin/aquanet-tra &
- please change <VMDS_IP> and <VMDS_PORT> with the actual IP address and port number of the VMDS emulator:
e.g., if the VMDS server is running on the same machine where the client is running, then the IP address is local: 127.0.0.1
- run the script:
chmod +x vm_aloha_sroute_tra_ros.sh ./vm_aloha_sroute_tra_ros.sh
At this point, we have started the VMDM server and clients on L1, and the rest of the stack up to L4.
Now, to start the application layer, execute the modified turtle_teleop_key_client in the same folder:
source $ROS_FOLDER/install_isolated/setup.bash
roscore
- in a new terminal:
cd $ROS_FOLDER/src/ros_tutorials/turtlesim/tutorials rosrun turtlesim turtle_teleop_key_client
If everything is initialized correctly, you should be able to see AQUA_* socket files inside the same directory:
ls $ROS_FOLDER/src/ros_tutorials/turtlesim/tutorials AQUA_APP AQUA_TRA aquanet_socket.h config_conn.cfg teleop_turtle_key .cpp AQUA_MAC aquanet_log.h aquanet_time.h config_net.cfg teleop_turtle_ke y_client.cpp AQUA_NET aquanet_netif.h config_add.cfg draw_square.cpp vm_aloha_sroute_ tra_ros.sh AQUA_PHY aquanet_pdu.h config_arp.cfg mimic.cpp
Running the server side
To connect another machine to the same stack, use the IP address and port of the machine where VMDM-server is started.
The rest of the steps are the same, except for an application – you may want to change it toturtle_teleop_key_server to be able to receive data from aqua-socket:
- create a bash-script inside the ROS package to start the layers for L2 to L4:
cd $ROS_FOLDER/src/ros_tutorials/turtlesim/tutorials touch vm_aloha_sroute_tra_ros_server.sh
- insert the following code into vm_aloha_sroute_tra_ros_server.sh file:
#!/bin/sh # Initialize L2-L4 modules on localhost # start the protocol stack $AQUANET_FOLDER/trunk/bin/aquanet-stack & sleep 2 # start the VMDM # modify IP and Port number, if necessary # $AQUANET_FOLDER /trunk/bin/aquanet-vmdc 127.0.0.1 2021 2 20 20 20 & $AQUANET_FOLDER/trunk/bin/aquanet-vmdc <VMDS_IP> <VMDS_PORT> 2 20 20 20 & sleep 4 # start the MAC $AQUANET_FOLDER/trunk/bin/aquanet-uwaloha & sleep 2 # start the routing protocol $AQUANET_FOLDER/trunk/bin/aquanet-sroute & sleep 2 # start the transport layer $AQUANET_FOLDER/trunk/bin/aquanet-tra &
please change <VMDS_IP> and <VMDS_PORT> with the actual IP address and port number of the VMDS emulator:
e.g., if the VMDS server is still running on the machine where the client-program is running, then the IP address should be a public address of the client machine, e.g.: 10.13.13.101.
- run the script:
chmod +x vm_aloha_sroute_tra_ros_server.sh ./vm_aloha_sroute_tra_ros_server.sh
At this point, we have started the server side and the rest of the stack up to L4.
source $ROS_FOLDER/install_isolated/setup.bash
roscore
Now, in a new terminal, start the server-application layer by executing the modified turtle_teleop_key_server in the same folder:
cd $ROS_FOLDER/src/ros_tutorials/turtlesim/tutorials rosrun turtlesim turtle_teleop_key_server
Again, if everything is initialized correctly, you should be able to see AQUA_* socket files inside the same directory:
ls $ROS_FOLDER/src/ros_tutorials/turtlesim/tutorials AQUA_APP AQUA_TRA aquanet_socket.h config_conn.cfg teleop_turtle_key .cpp AQUA_MAC aquanet_log.h aquanet_time.h config_net.cfg teleop_turtle_ke y_client.cpp AQUA_NET aquanet_netif.h config_add.cfg draw_square.cpp vm_aloha_sroute_ tra_ros.sh AQUA_PHY aquanet_pdu.h config_arp.cfg mimic.cpp
Note:
The AquaNet Virtual Modem Server (VMDS) for L1 emulation can be run on a separate machine, independently from both client and server machines. If that is the case, please make sure that the IP address and the port number of the VMDS server are publicly accessible for both the client and the server parts. The corresponding .sh files must also be modified to reflect the public IP address of the VMDS emulator.