Skip to content

Commit

Permalink
pulled integration
Browse files Browse the repository at this point in the history
  • Loading branch information
neuenfeldttj committed Apr 29, 2024
2 parents fcbda76 + 032f3b7 commit a287fcb
Show file tree
Hide file tree
Showing 61 changed files with 1,289 additions and 681 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,11 @@ if (CUDA_FOUND)
# target_include_directories(nv_vid_codec_h265_enc SYSTEM PUBLIC deps/nvenc)
endif ()

mrover_add_nodelet(gst_websocket_streamer src/esw/gst_websocket_streamer/*.c* src/esw/gst_websocket_streamer src/esw/gst_websocket_streamer/pch.hpp)
mrover_nodelet_link_libraries(gst_websocket_streamer PRIVATE websocket_server ${Gst_LIBRARIES} ${GstApp_LIBRARIES})
mrover_nodelet_include_directories(gst_websocket_streamer ${Gst_INCLUDE_DIRS} ${GstApp_INCLUDE_DIRS})
if (Gst_FOUND AND GstApp_FOUND AND LibUsb_FOUND AND LibUdev_FOUND)
mrover_add_nodelet(gst_websocket_streamer src/esw/gst_websocket_streamer/*.c* src/esw/gst_websocket_streamer src/esw/gst_websocket_streamer/pch.hpp)
mrover_nodelet_link_libraries(gst_websocket_streamer PRIVATE websocket_server ${Gst_LIBRARIES} ${GstApp_LIBRARIES} ${LibUsb_LIBRARIES} ${LibUdev_LIBRARIES} opencv_core opencv_imgproc)
mrover_nodelet_include_directories(gst_websocket_streamer ${Gst_INCLUDE_DIRS} ${GstApp_INCLUDE_DIRS} ${LibUsb_INCLUDE_DIRS} ${LibUdev_INCLUDE_DIRS})
endif ()

if (ZED_FOUND)
mrover_add_nodelet(object_detector src/perception/object_detector/*.c* src/perception/object_detector src/perception/object_detector/pch.hpp)
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/build/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
- libgstreamer1.0-dev
- libgstreamer-plugins-base1.0-dev
- vainfo
- x264

- name: Install Local APT Packages
become: True
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/esw/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

- name: Install Moteus GUI
pip:
name: moteus_gui
name: moteus-gui
6 changes: 6 additions & 0 deletions ansible/roles/jetson_services/files/rules/99-usb-serial.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SUBSYSTEM=="tty", ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a9", SYMLINK+="gps_%n"
SUBSYSTEM=="tty", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0058", SYMLINK+="imu"
SUBSYSTEM=="video4linux", KERNEL=="video*", ATTRS{idVendor}=="1bcf", ATTRS{idProduct}=="0b12", ATTR{index}=="0", GROUP="video", SYMLINK+="arducam"
SUBSYSTEM=="video4linux", KERNEL=="video*", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f582", ATTR{index}=="0", GROUP="video", SYMLINK+="zed"
SUBSYSTEM=="video4linux", KERNEL=="video*", ATTRS{idVendor}=="05a3", ATTRS{idProduct}=="9601", ATTR{index}=="0", GROUP="video", SYMLINK+="mobcam"
SUBSYSTEM=="video4linux", KERNEL=="video*", ATTRS{idVendor}=="32e4", ATTRS{idProduct}=="9601", ATTR{index}=="0", GROUP="video", SYMLINK+="staticcam"
14 changes: 14 additions & 0 deletions ansible/roles/jetson_services/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- name: USB Rules
become: true
synchronize:
src: files/rules/
dest: /etc/udev/rules.d
recursive: true

- name: udev Reload Rules
become: true
command: udevadm control --reload-rules

- name: udev TTY Trigger
become: true
command: udevadm trigger --subsystem-match=tty
2 changes: 2 additions & 0 deletions cmake/deps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,5 @@ pkg_search_module(NetLink libnl-3.0 QUIET)
pkg_search_module(NetLinkRoute libnl-route-3.0 QUIET)
pkg_search_module(Gst gstreamer-1.0 QUIET)
pkg_search_module(GstApp gstreamer-app-1.0 QUIET)
pkg_search_module(LibUsb libusb-1.0 QUIET)
pkg_search_module(LibUdev libudev QUIET)
23 changes: 16 additions & 7 deletions config/esw.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
right_gps_driver:
port: "/dev/ttyACM0"
baud: 38400
frame_id: "base_link"

left_gps_driver:
port: "/dev/gps"
baud: 38400
frame_id: "base_link"

basestation_gps_driver:
port: "/dev/gps"
baud: 38400
frame_id: "base_link"

imu_driver:
port: "/dev/imu"
baud: 115200
frame_id: "imu_link"

gps:
port: "/dev/gps"
baud: 115200
useRMC: false # get covariance instead of velocity, see wiki for more info
frame_id: "base_link"

can:
devices:
- name: "jetson"
Expand Down Expand Up @@ -591,7 +600,7 @@ motors:
default_network_iface: "enp0s31f6"

auton_led_driver:
port: "/dev/ttyACM0"
port: "/dev/led"
baud: 115200

science:
Expand Down
1 change: 1 addition & 0 deletions config/localization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ gps_linearization:
reference_point_longitude: -83.7096706
reference_point_altitude: 234.1
reference_heading: 90.0
use_both_gps: false
2 changes: 2 additions & 0 deletions config/teleop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ teleop:
multiplier: 0.6
tilt:
multiplier: 1
pan:
multiplier: 1

xbox_mappings:
left_x: 0
Expand Down
2 changes: 1 addition & 1 deletion deps/dawn
Submodule dawn updated from e12af2 to 509682
2 changes: 1 addition & 1 deletion launch/autonomy.launch
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<arg name="run_object_detector" default="false" />

<arg name="sim" default="false" />
<arg name="use_ekf" default="true" />
<arg name="use_ekf" default="false" />
<arg name="ekf_start_delay" default="0" />

<include file="$(find mrover)/launch/perception.launch">
Expand Down
6 changes: 5 additions & 1 deletion launch/basestation.launch
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,25 @@
<arg name="run_backend" default="true" />
<arg name="run_frontend" default="true" />
<arg name="run_browser" default="true" />
<arg name="rtk" default="true" />

<rosparam command="load" file="$(find mrover)/config/esw.yaml" />
<rosparam command="load" file="$(find mrover)/config/teleop.yaml" />
<rosparam command="load" file="$(find mrover)/config/localization.yaml" />

<node if="$(arg run_frontend)" name="gui_frontend" pkg="mrover" type="gui_frontend.sh" cwd="node" required="true" />
<node if="$(arg run_backend)" name="gui_backend" pkg="mrover" type="gui_backend.sh" cwd="node" required="true" />
<node if="$(arg run_browser)" name="gui_chromium" pkg="mrover" type="gui_chromium.sh" />
<node if="$(arg run_browser)" name="gui_chromium_menu" pkg="mrover" type="gui_chromium_menu.sh" />
<node if="$(arg run_browser)" name="gui_chromium_cameras" pkg="mrover" type="gui_chromium_cameras.sh" />

<group if="$(arg run_rviz)">
<arg name="rvizconfig" default="$(find mrover)/config/rviz/basestation.rviz" />
<node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" />
<node name="topic_services" pkg="mrover" type="topic_services.py" />
</group>

<include if="$(arg rtk)" file="$(find mrover)/launch/rtk_basestation.launch" />

<!-- network monitor node-->
<node if="$(arg run_network_monitor)"
name="network_monitor" pkg="mrover" type="network_monitor.py" />
Expand Down
124 changes: 57 additions & 67 deletions launch/esw_base.launch
Original file line number Diff line number Diff line change
@@ -1,77 +1,67 @@
<launch>
<rosparam command="load" file="$(find mrover)/config/esw.yaml" />
<rosparam command="load" file="$(find mrover)/config/esw.yaml"/>

<!-- Bridges between ROS and SocketCAN -->
<!-- <node name="can_driver_0" pkg="mrover" type="can_driver"
respawn="true" respawn_delay="2"
output="screen">
<param name="interface" value="can0" />
</node> -->
<node name="can_driver_1" pkg="mrover" type="can_driver"
respawn="true" respawn_delay="2"
output="screen">
<param name="interface" value="can1" />
</node>
<node name="can_driver_2" pkg="mrover" type="can_driver"
respawn="true" respawn_delay="2"
output="screen">
<param name="interface" value="can2" />
</node>
<node name="can_driver_3" pkg="mrover" type="can_driver"
respawn="true" respawn_delay="2"
output="screen">
<param name="interface" value="can3" />
</node>
<node name="can_driver_1" pkg="mrover" type="can_driver"
respawn="true" respawn_delay="2"
output="screen">
<param name="interface" value="can1"/>
</node>
<node name="can_driver_2" pkg="mrover" type="can_driver"
respawn="true" respawn_delay="2"
output="screen">
<param name="interface" value="can2"/>
</node>
<node name="can_driver_3" pkg="mrover" type="can_driver"
respawn="true" respawn_delay="2"
output="screen">
<param name="interface" value="can3"/>
</node>

<node pkg="mrover" type="gst_websocket_streamer" name="gst_websocket_streamer_0"
output="screen">
<param name="device" value="/dev/video0" />
<param name="port" value="8081" />
<param name="width" value="1280" />
<param name="height" value="720" />
</node>
<node pkg="nodelet" type="nodelet" name="streamer_nodelet_mobility"
args="load mrover/GstWebsocketStreamerNodelet perception_nodelet_manager"
output="screen">
<param name="dev_node" value="/dev/mobcam"/>
<param name="port" value="8083"/>
<param name="width" value="1280"/>
<param name="height" value="720"/>
</node>

<node pkg="mrover" type="gst_websocket_streamer" name="gst_websocket_streamer_1"
output="screen">
<param name="device" value="/dev/video2" />
<param name="port" value="8082" />
<param name="width" value="1280" />
<param name="height" value="720" />
</node>
<node pkg="nodelet" type="nodelet" name="streamer_nodelet_static"
args="load mrover/GstWebsocketStreamerNodelet perception_nodelet_manager"
output="screen">
<param name="dev_node" value="/dev/staticcam"/>
<param name="port" value="8082"/>
<param name="width" value="1280"/>
<param name="height" value="720"/>
</node>

<node pkg="mrover" type="gst_websocket_streamer" name="gst_websocket_streamer_2"
output="screen">
<param name="device" value="/dev/video4" />
<param name="port" value="8083" />
<param name="width" value="1280" />
<param name="height" value="720" />
</node>
<!-- <node pkg="nodelet" type="nodelet" name="streamer_nodelet_finger"
args="load mrover/GstWebsocketStreamerNodelet perception_nodelet_manager"
output="screen">
<param name="dev_node" value="/dev/video4"/>
<param name="port" value="8083"/>
<param name="width" value="1280"/>
<param name="height" value="720"/>
</node> -->

<node pkg="mrover" type="gst_websocket_streamer" name="gst_websocket_streamer_zed"
output="screen">
<param name="image_topic" value="/camera/left/image" />
<param name="port" value="8084" />
<param name="width" value="1280" />
<param name="height" value="720" />
</node>

<!-- <node pkg="mrover" type="gst_websocket_streamer" name="gst_websocket_streamer_3"
output="screen">
<param name="device" value="/dev/video6" />
<param name="port" value="8084" />
<param name="width" value="640" />
<param name="height" value="480" />
</node> -->
<node pkg="nodelet" type="nodelet" name="streamer_nodelet_zed"
args="load mrover/GstWebsocketStreamerNodelet perception_nodelet_manager"
output="screen">
<param name="image_topic" value="/camera/left/image"/>
<param name="port" value="8081"/>
<param name="width" value="1280"/>
<param name="height" value="720"/>
</node>

<node name="drive_bridge" pkg="mrover" type="drive_bridge" output="screen" />
<node name="drive_bridge" pkg="mrover" type="drive_bridge" output="screen"/>

<!-- Interprets status from navigation and teleoperation to deliver the correct LED mode to
the bridge -->
<node name="led" pkg="mrover" type="led" output="screen" />
<!-- This is the STM bridge, not working right now for unknown reasons -->
<!-- <node name="led_hw_bridge" pkg="mrover" type="led_hw_bridge" /> -->
<node name="arduino_led_hw_bridge" pkg="mrover" type="arduino_led_hw_bridge.py"
output="screen" />
<!-- Interprets status from navigation and teleoperation to deliver the correct LED mode to
the bridge -->
<node name="led" pkg="mrover" type="led" output="screen"/>
<!-- This is the STM bridge, not working right now for unknown reasons -->
<!-- <node name="led_hw_bridge" pkg="mrover" type="led_hw_bridge" /> -->
<node name="arduino_led_hw_bridge" pkg="mrover" type="arduino_led_hw_bridge.py"
output="screen"/>

<node name="mast_gimbal_bridge" pkg="mrover" type="mast_gimbal_bridge" output="screen" />
<node name="mast_gimbal_bridge" pkg="mrover" type="mast_gimbal_bridge" output="screen"/>
</launch>
13 changes: 9 additions & 4 deletions launch/localization.launch
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<launch>
<arg name="sim" default="false" />
<arg name="use_ekf" default="true" />
<arg name="use_ekf" default="false" />
<arg name="ekf_start_delay" default="0" />
<arg name="use_both_gps" default="false" />

<rosparam command="load" file="$(find mrover)/config/localization.yaml" />
<rosparam command="load" file="$(find mrover)/config/esw.yaml" />
Expand All @@ -25,9 +26,13 @@
<!-- Launch IMU driver -->
<node unless="$(arg sim)" name="imu_driver" pkg="mrover" type="imu_driver.py" output="screen" />

<!-- Launch GPS driver -->
<group ns="gps">
<node unless="$(arg sim)" name="gps_driver" pkg="mrover" type="gps_driver.py" output="screen" />
<!-- Launch GPS driver(s) -->
<group ns="right_gps_driver" unless="$(arg sim)">
<node if="$(arg use_both_gps)" pkg="mrover" type="gps_driver.py" name="gps_driver" output="screen"/>
</group>

<group ns="left_gps_driver" unless="$(arg sim)">
<node pkg="mrover" type="gps_driver.py" name="gps_driver" output="screen"/>
</group>

</launch>
9 changes: 9 additions & 0 deletions launch/rtk_basestation.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>

<launch>

<rosparam command="load" file="$(find mrover)/config/esw.yaml" />
<node pkg="mrover" type="basestation_gps_driver.py" name="basestation_gps_driver"
output="screen" />

</launch>
20 changes: 20 additions & 0 deletions launch/rtk_rover.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>

<launch>
<arg name="use_both_gps" default="true" />

<rosparam command="load" file="$(find mrover)/config/esw.yaml" />
<rosparam command="load" file="$(find mrover)/config/localization.yaml" />
<rosparam command="load" file="$(find mrover)/config/ekf.yaml" />

<group ns="right_gps_driver">
<node if="$arg use_both_gps" pkg="mrover" type="gps_driver.py" name="gps_driver" output="screen"/>
</group>

<group ns="left_gps_driver">
<node pkg="mrover" type="gps_driver.py" name="gps_driver" output="screen"/>
</group>

<node pkg="mrover" type="gps_linearization.py" name="gps_linearization" output="screen"/>

</launch>
5 changes: 5 additions & 0 deletions launch/simulator.launch
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
<param name="headless" value="$(arg headless)"/>
</node>

<node pkg="nodelet" type="nodelet" name="streamer_nodelet"
args="load mrover/GstWebsocketStreamerNodelet perception_nodelet_manager" output="screen">
<param name="image_topic" value="/camera/left/image"/>
</node>

<node name="arm_controller" pkg="mrover" type="arm_controller" output="screen"/>

<group if="$(arg run_rviz)">
Expand Down
5 changes: 5 additions & 0 deletions msg/rtkStatus.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
uint8 NO_RTK = 0
uint8 FLOATING_RTK = 1
uint8 RTK_FIX = 2

uint8 RTK_FIX_TYPE
4 changes: 4 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,16 @@
<!-- Localization -->
<depend>rviz_imu_plugin</depend>
<depend>robot_localization</depend>
<depend>rtcm_msgs</depend>

<!-- Navigation -->

<!-- Utility -->
<exec_depend>teleop_twist_joy</exec_depend>
<exec_depend>teleop_twist_keyboard</exec_depend>
<depend>rqt_tf_tree</depend>
<depend>rosbag</depend>
<depend>rqt_bag</depend>

<!-- Test -->
<test_depend>rosunit</test_depend>
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dependencies = [
"aenum==3.1.15",
"daphne==4.0.0",
"channels==4.0.0",
"pyubx2==1.2.35",
"opencv-python==4.9.0.80",
]

Expand Down
Loading

0 comments on commit a287fcb

Please sign in to comment.