Cleanup deps. Add params. Setup mediamts and image2rtsp.
This commit is contained in:
parent
0113cd4a12
commit
137fb39ef9
|
|
@ -12,9 +12,9 @@ install(DIRECTORY
|
||||||
USE_SOURCE_PERMISSIONS
|
USE_SOURCE_PERMISSIONS
|
||||||
)
|
)
|
||||||
|
|
||||||
# Install launch files.
|
# Install launch and param files.
|
||||||
install(DIRECTORY
|
install(DIRECTORY
|
||||||
launch
|
launch params
|
||||||
DESTINATION share/${PROJECT_NAME}/
|
DESTINATION share/${PROJECT_NAME}/
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ class Api:
|
||||||
self._facts = facts
|
self._facts = facts
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
ui_share_directory = get_package_share_directory("am_i_up_ui")
|
ui_share_directory = get_package_share_directory(self._facts.get_ui_pkg())
|
||||||
ui_static_directory = ui_share_directory + "/dist/assets"
|
ui_static_directory = ui_share_directory + "/dist/assets"
|
||||||
|
|
||||||
app = web.Application()
|
app = web.Application()
|
||||||
|
|
@ -37,7 +37,7 @@ class Api:
|
||||||
])
|
])
|
||||||
|
|
||||||
url = "0.0.0.0"
|
url = "0.0.0.0"
|
||||||
port = 8888
|
port = self._facts.get_listen_port()
|
||||||
print("Listening on {}:{}".format(url, port))
|
print("Listening on {}:{}".format(url, port))
|
||||||
|
|
||||||
runner = web.AppRunner(app)
|
runner = web.AppRunner(app)
|
||||||
|
|
@ -50,7 +50,7 @@ class Api:
|
||||||
await runner.cleanup()
|
await runner.cleanup()
|
||||||
|
|
||||||
async def index(self, request):
|
async def index(self, request):
|
||||||
ui_share_directory = get_package_share_directory("am_i_up_ui")
|
ui_share_directory = get_package_share_directory(self._facts.get_ui_pkg())
|
||||||
ui_index_path = ui_share_directory + "/dist/index.html"
|
ui_index_path = ui_share_directory + "/dist/index.html"
|
||||||
return web.FileResponse(ui_index_path)
|
return web.FileResponse(ui_index_path)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,12 @@ class Facts:
|
||||||
def get_status(self):
|
def get_status(self):
|
||||||
return self._ros.get_status_string()
|
return self._ros.get_status_string()
|
||||||
|
|
||||||
|
def get_listen_port(self):
|
||||||
|
return self._ros.get_listen_port()
|
||||||
|
|
||||||
|
def get_ui_pkg(self):
|
||||||
|
return self._ros.get_ui_pkg()
|
||||||
|
|
||||||
def get_uptime(self):
|
def get_uptime(self):
|
||||||
return time.monotonic() - self._start_time
|
return time.monotonic() - self._start_time
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,9 @@ class Ros:
|
||||||
self._image_sub = self._node.create_subscription(CompressedImage, "image/compressed", self._image_callback, 1)
|
self._image_sub = self._node.create_subscription(CompressedImage, "image/compressed", self._image_callback, 1)
|
||||||
self._navsat_sub = self._node.create_subscription(NavSatFix, "navsatfix", self._navsat_callback, 1)
|
self._navsat_sub = self._node.create_subscription(NavSatFix, "navsatfix", self._navsat_callback, 1)
|
||||||
|
|
||||||
|
self._listen_port = self._node.declare_parameter("listen_port", "8888").value
|
||||||
|
self._ui_pkg = self._node.declare_parameter("ui_pkg", "am_i_up_ui").value
|
||||||
|
|
||||||
self._status_string = None
|
self._status_string = None
|
||||||
self._lat_long = None
|
self._lat_long = None
|
||||||
self._costmap_image = None
|
self._costmap_image = None
|
||||||
|
|
@ -36,6 +39,12 @@ class Ros:
|
||||||
def get_costmap_image(self):
|
def get_costmap_image(self):
|
||||||
return self._costmap_image
|
return self._costmap_image
|
||||||
|
|
||||||
|
def get_listen_port(self):
|
||||||
|
return self._listen_port
|
||||||
|
|
||||||
|
def get_ui_pkg(self):
|
||||||
|
return self._ui_pkg
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
while rclpy.ok():
|
while rclpy.ok():
|
||||||
rclpy.spin_once(self._node, timeout_sec=0)
|
rclpy.spin_once(self._node, timeout_sec=0)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,16 @@
|
||||||
<launch>
|
<launch>
|
||||||
<node pkg="am_i_up" exec="server" name="am_i_up"/>
|
<node pkg="am_i_up" exec="server" name="am_i_up">
|
||||||
|
<param from="$(find-pkg-share am_i_up)/params/am_i_up.yaml"/>
|
||||||
|
</node>
|
||||||
|
|
||||||
<node pkg="data_simulator" exec="image_publisher" name="image_publisher" />
|
<node pkg="data_simulator" exec="image_publisher" name="image_publisher" />
|
||||||
|
<node pkg="image2rtsp" exec="image2rtsp" name="image2rtsp">
|
||||||
|
<env name="GST_DEBUG" value="3"/>
|
||||||
|
<param from="$(find-pkg-share am_i_up)/params/image2rtsp.yaml"/>
|
||||||
|
</node>
|
||||||
|
<include file="$(find-pkg-share media_mtx_wrapper)/launch/mediamtx.launch.xml">
|
||||||
|
<arg name="config_file_path" value="$(find-pkg-share am_i_up)/params/mediamtx.yaml" />
|
||||||
|
</include>
|
||||||
|
|
||||||
<node pkg="data_simulator" exec="position_publisher" name="position_publisher" />
|
<node pkg="data_simulator" exec="position_publisher" name="position_publisher" />
|
||||||
</launch>
|
</launch>
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
<buildtool_depend>ament_cmake_python</buildtool_depend>
|
<buildtool_depend>ament_cmake_python</buildtool_depend>
|
||||||
<depend>python3-aiohttp</depend>
|
<depend>python3-aiohttp</depend>
|
||||||
<depend>python3-jinja2</depend>
|
|
||||||
<!-- TODO: Run time dep on ping -->
|
<!-- TODO: Run time dep on ping -->
|
||||||
|
|
||||||
<exec_depend>rclpy</exec_depend>
|
<exec_depend>rclpy</exec_depend>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
/**:
|
||||||
|
ros__parameters:
|
||||||
|
ui_pkg: "am_i_up_ui"
|
||||||
|
listen_port: "8000"
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
/**:
|
||||||
|
ros__parameters:
|
||||||
|
compressed: True
|
||||||
|
topic: "image/compressed"
|
||||||
|
mountpoint: "/image"
|
||||||
|
port: "8559"
|
||||||
|
local_only: True
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
paths:
|
||||||
|
image:
|
||||||
|
source: rtsp://127.0.0.1:8559/image
|
||||||
Loading…
Reference in New Issue