Skip to content

Commit

Permalink
improved remote startup
Browse files Browse the repository at this point in the history
  • Loading branch information
anion0278 committed Feb 8, 2022
1 parent 0431aac commit 31aa2c3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ jetson_camera_node/src/mediapipe_node/__pycache__/udp.cpython-36.pyc
jetson_camera_node/src/mediapipe_node/model/__pycache__/__init__.cpython-36.pyc
jetson_camera_node/src/mediapipe_node/model/keypoint_classifier/__pycache__/keypoint_classifier.cpython-36.pyc
.gitignore
jetson_camera_node/src/mediapipe_node/__pycache__/hand_data.cpython-36.pyc
jetson_camera_node/src/mediapipe_node/__pycache__/udp.cpython-36.pyc
jetson_camera_node/src/mediapipe_node/model/__pycache__/__init__.cpython-36.pyc
jetson_camera_node/src/mediapipe_node/model/keypoint_classifier/__pycache__/keypoint_classifier.cpython-36.pyc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<arg name="ip" value="192.168.1.146" />
<arg name="ip_suffix" value="192_168_1_146" />
<arg name="calibration_name" value="middle" />
<!-- <arg name="cam_width" value="640" />
<arg name="cam_height" value="480" />
<arg name="cam_rate" value="30" /> -->
</include>

<include file="$(find jetson_camera_node)/launch/start_single_distributed_tracking.launch">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
<arg name="ip" />
<arg name="ip_suffix" />
<arg name="calibration_name" />
<arg name="cam_width" default="424" />
<arg name="cam_height" default="240" />
<arg name="cam_rate" default="15" />

<machine name="$(arg calibration_name)" address="$(arg ip)" user="k354jn1" password="t" env-loader="$(find jetson_camera_node)/launch/setup_env.sh" default="false" />

<node machine="$(arg calibration_name)" name="cam_data_processor_$(arg ip_suffix)" pkg="jetson_camera_node" type="main_node" args="_calibration_dir:=calibration/$(arg calibration_name)" respawn="true" output="screen"/>
<node machine="$(arg calibration_name)" name="hand_tracker_$(arg ip_suffix)" pkg="jetson_camera_node" type="hand_tracker.py" respawn="true" output="screen"/>
<node machine="$(arg calibration_name)" name="cam_data_processor_$(arg ip_suffix)" pkg="jetson_camera_node" type="main_node"
args="_calibration_dir:=calibration/$(arg calibration_name) _cam_res_height:=$(arg cam_height) _cam_res_width:=$(arg cam_width) _cam_rate:=$(arg cam_rate) _debug:=false"
respawn="true" output="screen"/>
<node machine="$(arg calibration_name)" name="hands_tracker_$(arg ip_suffix)" pkg="jetson_camera_node" type="hand_tracker.py" respawn="true" output="screen"/>
</launch>
5 changes: 3 additions & 2 deletions jetson_camera_node/src/mediapipe_node/main_node_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, node_names, debug = True):
self.right_pcl_publisher = rospy.Publisher("hands_point_clouds/right", PointCloud2, queue_size=1)

def __init_subscribers(self, node_names):
if len(node_names) == 0: ValueError("Check node names!")
if len(node_names) == 0: raise ValueError("No nodes were found! Check node names!")
subs = []
for node_name in node_names:
topic_name = node_name + config.hands_data_topic
Expand Down Expand Up @@ -166,7 +166,8 @@ def __get_most_frequent_category_or_first(self, list):
return occurence_count.most_common(1)[0][0]

def find_all_hand_tracker_nodes():
return sorted(list(filter(lambda t: t.startswith("/"+ config.hands_tracker_node_name), rosnode.get_node_names())))
print(rosnode.get_node_names())
return sorted(list(filter(lambda t: t.startswith("/"+config.hands_tracker_node_name), rosnode.get_node_names())))

if __name__ == "__main__":
proc = DataAggregateProcessor(find_all_hand_tracker_nodes())
Expand Down

0 comments on commit 31aa2c3

Please sign in to comment.