mirror of
https://github.com/OSURoboticsClub/Rover_2017_2018.git
synced 2025-11-08 10:11:14 +00:00
Created placeholder variables for every system node status & created init placeholder functions
This commit is contained in:
@@ -1,4 +1,19 @@
|
||||
int8 UTC_GPS_time
|
||||
int8 bogie_connection_1
|
||||
int8 bogie_connection_2
|
||||
int8 bogie_connection_3
|
||||
int8 arm_connection_status
|
||||
int8 arm_end_effector_connection_statuses
|
||||
int8 camera_zed
|
||||
int8 camera_undercarriage
|
||||
int8 camera_chassis
|
||||
int8 camera_main_navigation
|
||||
int8 sample_containment_connection_status
|
||||
int8 tower_connection_status
|
||||
int8 chassis_pan_tilt_connection_status
|
||||
int8 GPS_connection_status
|
||||
int8 jetson_CPU
|
||||
int8 jetson_RAM
|
||||
int8 jetson_EMMC
|
||||
int8 jetson_NVME_SSD
|
||||
int8 FrSky_controller_connection_status
|
||||
32
rover/system_statuses/scripts/.idea/workspace.xml
generated
32
rover/system_statuses/scripts/.idea/workspace.xml
generated
@@ -14,8 +14,8 @@
|
||||
<file leaf-file-name="system_statuses_node.py" pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/system_statuses_node.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="84">
|
||||
<caret line="29" column="48" lean-forward="false" selection-start-line="29" selection-start-column="48" selection-end-line="29" selection-end-column="48" />
|
||||
<state relative-caret-position="372">
|
||||
<caret line="105" column="55" lean-forward="true" selection-start-line="105" selection-start-column="55" selection-end-line="105" selection-end-column="55" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
@@ -24,9 +24,11 @@
|
||||
<file leaf-file-name="camera_2_updater.py" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/camera_2_updater.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="48">
|
||||
<caret line="2" column="12" lean-forward="true" selection-start-line="2" selection-start-column="12" selection-end-line="2" selection-end-column="12" />
|
||||
<folding />
|
||||
<state relative-caret-position="216">
|
||||
<caret line="9" column="33" lean-forward="false" selection-start-line="9" selection-start-column="33" selection-end-line="9" selection-end-column="33" />
|
||||
<folding>
|
||||
<element signature="e#23#35#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
@@ -49,8 +51,8 @@
|
||||
<sorting>DEFINITION_ORDER</sorting>
|
||||
</component>
|
||||
<component name="ProjectFrameBounds">
|
||||
<option name="x" value="1141" />
|
||||
<option name="y" value="383" />
|
||||
<option name="x" value="1118" />
|
||||
<option name="y" value="372" />
|
||||
<option name="width" value="1595" />
|
||||
<option name="height" value="1205" />
|
||||
</component>
|
||||
@@ -118,7 +120,7 @@
|
||||
<servers />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="1141" y="383" width="1595" height="1205" extended-state="0" />
|
||||
<frame x="1118" y="372" width="1595" height="1205" extended-state="0" />
|
||||
<editor active="true" />
|
||||
<layout>
|
||||
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
||||
@@ -130,6 +132,7 @@
|
||||
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.116234995" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
||||
<window_info id="Docker" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3294347" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="SciView" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
|
||||
@@ -139,7 +142,6 @@
|
||||
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
|
||||
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
</layout>
|
||||
</component>
|
||||
@@ -159,16 +161,18 @@
|
||||
<entry file="file://$PROJECT_DIR$/system_statuses.py" />
|
||||
<entry file="file://$PROJECT_DIR$/camera_2_updater.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="48">
|
||||
<caret line="2" column="12" lean-forward="true" selection-start-line="2" selection-start-column="12" selection-end-line="2" selection-end-column="12" />
|
||||
<folding />
|
||||
<state relative-caret-position="216">
|
||||
<caret line="9" column="33" lean-forward="false" selection-start-line="9" selection-start-column="33" selection-end-line="9" selection-end-column="33" />
|
||||
<folding>
|
||||
<element signature="e#23#35#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/system_statuses_node.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="84">
|
||||
<caret line="29" column="48" lean-forward="false" selection-start-line="29" selection-start-column="48" selection-end-line="29" selection-end-column="48" />
|
||||
<state relative-caret-position="372">
|
||||
<caret line="105" column="55" lean-forward="true" selection-start-line="105" selection-start-column="55" selection-end-line="105" selection-end-column="55" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
|
||||
@@ -21,7 +21,9 @@ class SystemStatuses:
|
||||
rospy.Subscriber('camera_2_changer_chatter', Camera2Changer, self.__sub_callback)
|
||||
|
||||
self.msg = RoverSysStatus()
|
||||
self.__set_cameras()
|
||||
self.__set_msg_values()
|
||||
# self.__set_cameras()
|
||||
# self.__UTC_GPS_Time()
|
||||
|
||||
# Simple Subscriber test boolean -- camera_2_updated.py
|
||||
# self.hasCameraUndercarriageChanged = False
|
||||
@@ -34,6 +36,39 @@ class SystemStatuses:
|
||||
self.msg.camera_undercarriage = data.camera_2_value
|
||||
self.hasCameraUndercarriageChanged = True
|
||||
|
||||
# INIT all RoverSysMessage values
|
||||
def __set_msg_values(self):
|
||||
self.__utc_gps_time()
|
||||
self.__bogie_connection_statuses()
|
||||
self.__arm_connection_status()
|
||||
self.__arm_end_effector_connection_statuses()
|
||||
self.__set_cameras()
|
||||
self.__sample_containment_connection_status()
|
||||
self.__tower_connection_status()
|
||||
self.__chassis_pan_tilt_connection_status()
|
||||
self.__gps_connection_status()
|
||||
self.__jetson_usage_information()
|
||||
self.__frsky_controller_connection_status()
|
||||
|
||||
# Pulls the UTC GPS Time (WIP)
|
||||
def __utc_gps_time(self):
|
||||
self.msg.UTC_GPS_time = 0
|
||||
|
||||
# Pulls bogie connection statuses (WIP)
|
||||
def __bogie_connection_statuses(self):
|
||||
self.msg.bogie_connection_1 = 0
|
||||
self.msg.bogie_connection_2 = 0
|
||||
self.msg.bogie_connection_3 = 0
|
||||
|
||||
# Checks arm connection status (WIP)
|
||||
def __arm_connection_status(self):
|
||||
self.msg.arm_connection_status = 0
|
||||
|
||||
# Checks Arm End Effector Connection Statuses (WIP)
|
||||
def __arm_end_effector_connection_statuses(self):
|
||||
self.msg.arm_end_effector_connection_statuses = 0
|
||||
|
||||
# Sets the Camera values (zed, undercarriage, chassis, and main_nav
|
||||
def __set_cameras(self):
|
||||
# Check if camera_zed is found
|
||||
self.msg.camera_zed = 1 if os.path.exists(self.system_path_locations[0]) else 0
|
||||
@@ -44,8 +79,36 @@ class SystemStatuses:
|
||||
# Check if camera_main_navigation is found
|
||||
self.msg.camera_main_navigation = 1 if os.path.exists(self.system_path_locations[3]) else 0
|
||||
|
||||
# Checks Sample Containment Connection Status (WIP)
|
||||
def __sample_containment_connection_status(self):
|
||||
self.msg.sample_containment_connection_status = 0
|
||||
|
||||
def __tower_connection_status(self):
|
||||
self.msg.tower_connection_status = 0
|
||||
|
||||
# Checks Tower Connection Status (WIP)
|
||||
def __chassis_pan_tilt_connection_status(self):
|
||||
self.msg.chassis_pan_tilt_connection_status = 0
|
||||
|
||||
# Checks GPS Status (WIP)
|
||||
def __gps_connection_status(self):
|
||||
self.msg.GPS_connection_status = 0
|
||||
|
||||
# Get Jetson Statuses (WIP)
|
||||
def __jetson_usage_information(self):
|
||||
self.msg.jetson_CPU = 0
|
||||
self.msg.jetson_RAM = 0
|
||||
self.msg.jetson_EMMC = 0
|
||||
self.msg.jetson_NVME_SSD = 0
|
||||
|
||||
# Check FrSky Controller Connection Status (WIP)
|
||||
def __frsky_controller_connection_status(self):
|
||||
self.msg.FrSky_controller_connection_status = 0
|
||||
|
||||
def run(self):
|
||||
r = rospy.Rate(10)
|
||||
rospy.loginfo(self.msg)
|
||||
self.pub.publish(self.msg)
|
||||
while not rospy.is_shutdown():
|
||||
if (self.msg.camera_zed != os.path.exists(self.system_path_locations[0]) or
|
||||
self.msg.camera_undercarriage != os.path.exists(self.system_path_locations[1]) or
|
||||
|
||||
Reference in New Issue
Block a user