Actually added system_statuses node files & debug files in, symlinked to local catkin_ws for local make

This commit is contained in:
MatthewTaylor24
2018-01-13 18:30:18 -08:00
parent 6d7fa80778
commit a40092ad99
11 changed files with 578 additions and 1 deletions

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 2.7" project-jdk-type="Python SDK" />
</project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/scripts.iml" filepath="$PROJECT_DIR$/.idea/scripts.iml" />
</modules>
</component>
</project>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
<option name="projectConfiguration" value="Nosetests" />
<option name="PROJECT_TEST_RUNNER" value="Nosetests" />
</component>
</module>

View File

@@ -0,0 +1,188 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="70471578-1307-4c98-9010-bffc2d7cc71c" name="Default" comment="" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileEditorManager">
<leaf>
<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="552">
<caret line="47" column="0" lean-forward="true" selection-start-line="47" selection-start-column="0" selection-end-line="47" selection-end-column="0" />
<folding>
<element signature="e#22#43#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<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>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/camera_2_updater.py" />
<option value="$PROJECT_DIR$/system_statuses.py" />
<option value="$PROJECT_DIR$/system_statuses_node.py" />
</list>
</option>
</component>
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsGulpfileManager">
<detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="ProjectFrameBounds">
<option name="x" value="1141" />
<option name="y" value="383" />
<option name="width" value="1595" />
<option name="height" value="1205" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scratches" />
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="scripts" type="b2602c69:ProjectViewProjectNode" />
<item name="scripts" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="70471578-1307-4c98-9010-bffc2d7cc71c" name="Default" comment="" />
<created>1515892189770</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1515892189770</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="1141" y="383" 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" />
<window_info id="Event Log" 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="true" content_ui="tabs" />
<window_info id="Version Control" 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="-1" side_tool="false" content_ui="tabs" />
<window_info id="Python Console" 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="Run" 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="2" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" 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="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="-1" 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="-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="-1" 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="-1" side_tool="true" content_ui="tabs" />
<window_info id="Debug" 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="3" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" 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="Message" 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="0" side_tool="false" content_ui="tabs" />
<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="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="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="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>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<option name="time" value="3" />
</breakpoint-manager>
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/system_statuses.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="576">
<caret line="24" column="51" lean-forward="true" selection-start-line="24" selection-start-column="51" selection-end-line="24" selection-end-column="51" />
<folding />
</state>
</provider>
</entry>
<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>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/system_statuses_node.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="552">
<caret line="47" column="0" lean-forward="true" selection-start-line="47" selection-start-column="0" selection-end-line="47" selection-end-column="0" />
<folding>
<element signature="e#22#43#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
</project>

View File

@@ -0,0 +1,26 @@
#!/usr/bin/env python
import rospy
from system_statuses.msg import Camera2Changer
def camera_2_changer():
pub = rospy.Publisher('camera_2_changer_chatter', Camera2Changer, queue_size=10)
rospy.init_node('camera_2_changer_talker', anonymous=True)
# r = rospy.sleep(10) # 10hz
msg = Camera2Changer()
msg.camera_2_value = 0
while not rospy.is_shutdown():
msg.camera_2_value = (msg.camera_2_value + 1) % 2
rospy.loginfo(msg)
pub.publish(msg)
# r.sleep()
rospy.sleep(2.)
if __name__ == '__main__':
try:
camera_2_changer()
except rospy.ROSInterruptException:
pass

View File

@@ -0,0 +1,61 @@
#!/usr/bin/env python
import rospy, os.path
from system_statuses.msg import RoverSysStatus, Camera2Changer
class SystemStatuses:
def __init__(self):
self.system_path_locations = [
'/dev/rover/camera_zed',
'/dev/rover/camera_undercarriage',
'/dev/rover/camera_gimbal',
'/dev/rover/camera_main_navigation'
]
rospy.init_node('SystemStatuses')
self.pub = rospy.Publisher('rover_system_status_chatter', RoverSysStatus, queue_size=10)
# Test Subscription for updating camera_undercarriage
rospy.Subscriber('camera_2_changer_chatter', Camera2Changer, self.__sub_callback)
self.msg = RoverSysStatus()
# Check if camera_zed is found
self.msg.camera_zed = 1 if os.path.isfile(self.system_path_locations[0]) else 0
# Check if camera_undercarriage is found
self.msg.camera_undercarriage = 1 if os.path.isfile(self.system_path_locations[1]) else 0
# Check if camera_gimbal is found
self.msg.camera_gimbal = 1 if os.path.isfile(self.system_path_locations[2]) else 0
# Check if camera_main_navigation is found
self.msg.camera_main_navigation = 1 if os.path.isfile(self.system_path_locations[3]) else 0
# self.msg.camera_zed = 0
# self.msg.camera_undercarriage = 0
# self.msg.camera_gimbal = 0
# self.msg.camera_main_navigation = 0
# Simple Subscriber test boolean -- camera_2_updated.py
self.hasCameraUndercarriageChanged = False
# Callback for test Subscription of camera_2_updater.py -- checks if camera_undercarriage
# has changed, updates value, and updates bool for run->pub.publish to execute
def __sub_callback(self, data):
rospy.loginfo("Camera_undercarriage Status Changed: %d " % data.camera_2_value)
if self.msg.camera_undercarriage != data.camera_2_value:
self.msg.camera_undercarriage = data.camera_2_value
self.hasCameraUndercarriageChanged = True
def run(self):
r = rospy.Rate(10)
while not rospy.is_shutdown():
if self.hasCameraUndercarriageChanged:
rospy.loginfo(self.msg)
self.pub.publish(self.msg)
self.hasCameraUndercarriageChanged = False
r.sleep()
if __name__ == '__main__':
system_status = SystemStatuses()
system_status.run()