Skip to content

Commit 088c21b

Browse files
committed
Thruster Test - to test
1 parent cc47195 commit 088c21b

File tree

6 files changed

+72
-49
lines changed

6 files changed

+72
-49
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
%time,field.microseconds0,field.microseconds1,field.microseconds2,field.microseconds3,field.microseconds4,field.microseconds5,field.microseconds6,field.microseconds7
2+
1745783318062094688,1508,1500,1500,1500,1500,1500,1500,1500
3+
1745783321564683914,1500,1500,1500,1500,1500,1500,1500,1500

pio_workspace/test/thruster_tests/Docker/catkin_ws/src/propulsion/launch/propulsion.launch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<arg name="sim" default="false" />
33
<group unless="$(arg sim)">
44
<node name="thrusters_serial_server" pkg="rosserial_python" type="serial_node.py" respawn="true">
5-
<param name="port" value="/dev/power"/>
5+
<param name="port" value="/dev/ttyACM0"/>
66
<param name="baud" value="115200"/>
77
</node>
88
</group>

pio_workspace/test/thruster_tests/Docker/catkin_ws/src/propulsion/src/thruster_tests.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,10 @@
1919

2020
# Starting neutral array
2121
pwm_array = [1500] * 8
22+
time.sleep(15)
2223

2324
# Ascending sequence
2425
for pwm in range(1508, 1901, 8): # Changed step to 8
25-
# Initial arming
26-
pwm_array[thruster_num] = 1500
27-
pub.publish(ThrusterMicroseconds(pwm_array))
28-
time.sleep(15)
29-
3026
pwm_array[thruster_num] = pwm
3127
pub.publish(ThrusterMicroseconds(pwm_array))
3228
print(f"Sent PWM {pwm} to thruster {thruster_num + 1}")

pio_workspace/test/thruster_tests/Docker/tmux_thrusters.sh

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,29 @@ SESSION=auv_session
66
# Start a new tmux session, detached
77
tmux new-session -d -s $SESSION
88

9-
# In the first pane
10-
tmux send-keys -t $SESSION:0.0 'cd catkin_ws && catkin build && source devel/setup.bash && roslaunch propulsion propulsion.launch' C-m
9+
# In the first pane: Start roscore
10+
tmux send-keys -t $SESSION:0.0 'roscore' C-m
1111

1212
# Split horizontally to make second pane
13-
tmux split-window -h -t $SESSION
13+
tmux split-window -h -t $SESSION:0
1414

15-
# In the second pane
16-
tmux send-keys -t $SESSION:0.1 'cd catkin_ws && catkin build && source devel/setup.bash && rostopic echo /all/data' C-m
15+
# In the second pane: cd into catkin_ws, build, and launch the propulsion test
16+
tmux send-keys -t $SESSION:0.1 'cd catkin_ws && catkin build && source devel/setup.bash && roslaunch propulsion thrustertest.launch' C-m
1717

1818
# Split the first pane vertically to make third pane
1919
tmux select-pane -t $SESSION:0.0
2020
tmux split-window -v -t $SESSION
2121

22-
# In the third pane
23-
tmux send-keys -t $SESSION:0.2 'cd catkin_ws && catkin build && source devel/setup.bash && rostopic pub -r 10 /propulsion/microseconds auv_msgs/ThrusterMicroseconds "{microseconds: [1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500]}"' C-m
22+
# In the third pane: cd into catkin_ws, build, and echo /propulsion/microseconds topic
23+
tmux send-keys -t $SESSION:0.2 'cd catkin_ws && catkin build && source devel/setup.bash && rostopic echo /propulsion/microseconds' C-m
24+
25+
# Create a new pane and run rosserial node on /dev/ttyACM1
26+
tmux split-window -h -t $SESSION:0.2
27+
tmux send-keys -t $SESSION:0.3 'roslaunch rosserial_python serial_node.launch dev:=/dev/ttyACM1' C-m
28+
29+
# Create another pane and echo /all/data
30+
tmux split-window -v -t $SESSION:0.3
31+
tmux send-keys -t $SESSION:0.4 'cd catkin_ws && catkin build && source devel/setup.bash && rostopic echo /all/data' C-m
2432

2533
# Attach to the tmux session
2634
tmux attach-session -t $SESSION
27-
Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,17 @@
1-
CMD:
2-
usbipd list
3-
usbipd bind --busid <bus_id>
4-
usbipd attach --wsl --busid <bus_id>
1+
docker compose up
52

3+
docker exec -it docker-auv-container-1 bash
64

7-
UBUNTU:
8-
sudo docker run -it --rm --device=/dev/ttyUSB0 ros:noetic bash
5+
cd auv-2025/catkin_ws && catkin build && source devel/setup.bash && tmux
96

10-
11-
DOCKER:
12-
sudo apt update
13-
sudo apt install tmux -y
14-
sudo apt install git -y
15-
sudo apt install vim -y
16-
sudo apt install -y ros-noetic-rosserial
17-
sudo apt install python3-catkin-tools -y
18-
sudo apt install ros-noetic-rosserial-arduino ros-noetic-rosserial -y
19-
source /opt/ros/noetic/setup.bash
20-
21-
git clone https://github.com/mcgill-robotics/auv-2025
22-
cd auv-2025/catkin_ws
23-
catkin build
24-
source devel/setup.bash
25-
26-
TMUX:
277
1.
28-
catkin build
29-
source devel/setup.bash
30-
roslaunch propulsion propulsion.launch
8+
source devel/setup.bash && roslaunch rosserial_python serial_node.launch dev:=/dev/ttyACM1
319

3210
2.
33-
catkin build
34-
source devel/setup.bash
35-
rosrun rosserial_python serial_node.py _port:=/dev/ttyUSB0
11+
source devel/setup.bash && roslaunch propulsion thrustertest.launch
3612

3713
3.
38-
rostopic list
39-
rostopic echo /thruster/force
40-
14+
source devel/setup.bash && rostopic echo -p /all/data > /ThrusterX.csv
4115

42-
UBUNTU:
43-
sudo docker ps
44-
sudo docker cp <container_id>:<container_path> <destination_path>
16+
4.
17+
source devel/setup.bash && rostopic echo /all/data
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
CMD:
2+
usbipd list
3+
usbipd bind --busid <bus_id>
4+
usbipd attach --wsl --busid <bus_id>
5+
6+
7+
UBUNTU:
8+
sudo docker run -it --rm --device=/dev/ttyUSB0 ros:noetic bash
9+
10+
11+
DOCKER:
12+
sudo apt update
13+
sudo apt install tmux -y
14+
sudo apt install git -y
15+
sudo apt install vim -y
16+
sudo apt install -y ros-noetic-rosserial
17+
sudo apt install python3-catkin-tools -y
18+
sudo apt install ros-noetic-rosserial-arduino ros-noetic-rosserial -y
19+
source /opt/ros/noetic/setup.bash
20+
21+
git clone https://github.com/mcgill-robotics/auv-2025
22+
cd auv-2025/catkin_ws
23+
catkin build
24+
source devel/setup.bash
25+
26+
TMUX:
27+
1.
28+
catkin build
29+
source devel/setup.bash
30+
roslaunch propulsion propulsion.launch
31+
32+
2.
33+
catkin build
34+
source devel/setup.bash
35+
rosrun rosserial_python serial_node.py _port:=/dev/ttyUSB0
36+
37+
3.
38+
rostopic list
39+
rostopic echo /thruster/force
40+
41+
42+
UBUNTU:
43+
sudo docker ps
44+
sudo docker cp <container_id>:<container_path> <destination_path>

0 commit comments

Comments
 (0)