Skip to content

Commit ee449c9

Browse files
authored
Merge pull request #45 from OSURoboticsClub/nav_dev_odometry
Added odometry to imu, gps, and servo
2 parents b137c11 + 85edd0a commit ee449c9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+464212
-1078
lines changed
File renamed without changes.

software/bags/bag_data.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add validation and timestamp to ensure uniqueness
2+
if [ -z "$1" ]; then
3+
echo "Usage: $0 <bag_name>"
4+
exit 1
5+
fi
6+
7+
ros2 bag record \
8+
-s mcap -o ~/Rover_2023_2024/software/bags/$1 \
9+
/tf_static \
10+
/odometry/global \
11+
/odom \
12+
/imu/data \
13+
/gps/fix \
14+
/camera/d455/color/image_raw \
15+
/camera/d455/color/camera_info \
16+
/camera/d455/aligned_depth_to_color/image_raw \
17+
/tf

software/environment/rover/UDEV_rules/99-rover-cameras.rules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ KERNEL=="video[0-9]*", SUBSYSTEM=="video4linux", ATTRS{idVendor}=="32e4", ATTRS{
2121
KERNEL=="video[0-9]*", SUBSYSTEM=="video4linux", ATTRS{idVendor}=="05a3", ATTRS{idProduct}=="9422", ATTRS{serial}=="SN0001", ATTR{index}=="0", SYMLINK+="rover/camera_main_navigation_backup"
2222

2323
# lights/gps infrared camera
24-
KERNEL=="video[0-9]*", SUBSYSTEM=="video4linux", ATTRS{idVendor}=="0c45", ATTRS{idProduct}=="6369", SYMLINK+="rover/camera_infrared"
24+
KERNEL=="video[0-9]*", SUBSYSTEM=="video4linux", ATTRS{idVendor}=="0c45", ATTRS{idProduct}=="6369", ENV{ID_V4L_CAPABILITIES}==":capture:", SYMLINK+="rover/camera_infrared"

software/output.txt

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
1763525750.962177 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:40895 failed with retcode -1
2+
1763525751.004895 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:59703 failed with retcode -1
3+
1763525751.062229 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:40895 failed with retcode -1
4+
1763525751.104970 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:59703 failed with retcode -1
5+
1763525751.162307 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:40895 failed with retcode -1
6+
1763525751.262385 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:40895 failed with retcode -1
7+
1763525751.305036 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:59703 failed with retcode -1
8+
1763525751.347732 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:59703 failed with retcode -1
9+
1763525751.462458 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:40895 failed with retcode -1
10+
1763525751.505110 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:59703 failed with retcode -1
11+
1763525751.662543 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:40895 failed with retcode -1
12+
1763525751.705816 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:59975 failed with retcode -1
13+
1763525751.905183 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:59703 failed with retcode -1
14+
1763525752.305257 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:59703 failed with retcode -1
15+
1763525752.347805 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:59703 failed with retcode -1
16+
1763525752.706216 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:59975 failed with retcode -1
17+
1763525753.105346 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:59703 failed with retcode -1
18+
1763525753.279012 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
19+
1763525753.347884 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:59703 failed with retcode -1
20+
1763525753.379087 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
21+
1763525753.381952 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
22+
1763525753.479167 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
23+
1763525753.579676 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
24+
1763525753.679746 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
25+
1763525753.779828 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
26+
1763525753.879905 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
27+
1763525753.905506 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:59703 failed with retcode -1
28+
1763525754.079985 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
29+
1763525754.280070 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
30+
1763525754.680151 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
31+
1763525755.080232 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
32+
1763525755.505568 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:59703 failed with retcode -1
33+
1763525755.880304 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
34+
1763525756.680375 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
35+
1763525757.105776 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:59703 failed with retcode -1
36+
1763525758.280457 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
37+
1763525759.880532 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
38+
1763525760.305845 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:59703 failed with retcode -1
39+
1763525782.702797 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:43720 failed with retcode -1
40+
1763525782.702869 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
41+
1763525782.702886 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:43720 failed with retcode -1
42+
1763525782.707534 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:43720 failed with retcode -1
43+
1763525782.802893 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:43720 failed with retcode -1
44+
1763525782.802953 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
45+
1763525782.902968 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:43720 failed with retcode -1
46+
1763525782.903032 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
47+
1763525783.003041 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:43720 failed with retcode -1
48+
1763525783.003095 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
49+
1763525783.103113 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:43720 failed with retcode -1
50+
1763525783.103159 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
51+
1763525783.203183 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:43720 failed with retcode -1
52+
1763525783.203236 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
53+
1763525783.303250 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:43720 failed with retcode -1
54+
1763525783.303312 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
55+
1763525783.503319 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:43720 failed with retcode -1
56+
1763525783.503372 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
57+
1763525783.703685 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:43720 failed with retcode -1
58+
1763525783.703759 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
59+
1763525783.703775 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:43720 failed with retcode -1
60+
1763525783.713505 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:43720 failed with retcode -1
61+
1763525784.103942 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:43720 failed with retcode -1
62+
1763525784.103987 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
63+
1763525784.504028 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:43720 failed with retcode -1
64+
1763525784.504076 [0] tev: ddsi_udp_conn_write to udp/239.255.0.1:7400 failed with retcode -1
65+
1763525784.703736 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:43720 failed with retcode -1
66+
1763525784.713603 [0] tev: ddsi_udp_conn_write to udp/192.168.1.11:43720 failed with retcode -1

software/python_gstream_example.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import gi
2+
import sys
3+
gi.require_version('Gst', '1.0')
4+
from gi.repository import Gst, GLib
5+
6+
Gst.init(sys.argv)
7+
8+
# Optimized: Keep everything on GPU (NVMM memory)
9+
pipeline = Gst.parse_launch(
10+
'v4l2src do-timestamp=true device=/dev/rover/gripper-rgb ! '
11+
'image/jpeg,width=1920,height=1080,framerate=30/1 ! nvv4l2decoder mjpeg=1 ! nvvidconv ! video/x-raw ! tee name=t '
12+
't. ! queue ! appsink name=infrared_sink '
13+
't. ! queue ! videoscale ! video/x-raw,width=640,height=480,format=I420 ! '
14+
'nvvidconv ! video/x-raw(memory:NVMM),format=NV12 ! nvv4l2h265enc preset-level=1 bitrate=4000000 ! '
15+
'h265parse ! rtph265pay config-interval=1 ! rtpulpfecenc percentage=100 ! udpsink host=192.168.1.1 port=42068 sync=false'
16+
)
17+
def on_message(bus, message):
18+
t = message.type
19+
if t == Gst.MessageType.EOS:
20+
print("End of stream")
21+
loop.quit()
22+
elif t == Gst.MessageType.ERROR:
23+
err, debug = message.parse_error()
24+
print(f"Error: {err}")
25+
loop.quit()
26+
elif t == Gst.MessageType.WARNING:
27+
warn, debug = message.parse_warning()
28+
print(f"Warning: {warn}")
29+
return True
30+
31+
def main():
32+
global loop
33+
34+
bus = pipeline.get_bus()
35+
bus.add_signal_watch()
36+
bus.connect("message", on_message)
37+
38+
print("Starting pipeline...")
39+
ret = pipeline.set_state(Gst.State.PLAYING)
40+
if ret == Gst.StateChangeReturn.FAILURE:
41+
print("ERROR: Unable to set pipeline to PLAYING")
42+
sys.exit(1)
43+
44+
loop = GLib.MainLoop()
45+
try:
46+
loop.run()
47+
except KeyboardInterrupt:
48+
print("\nStopping...")
49+
finally:
50+
pipeline.set_state(Gst.State.NULL)
51+
52+
if __name__ == "__main__":
53+
main()

0 commit comments

Comments
 (0)