Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix microstrain rqt quickview after microstrain driver V3 #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/microstrain_inertial_rqt/filter_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ def __init__(self, node):
def _configure(self):
# Set up the subscriber status monitors
self._absolute_odom_monitor = OdomMonitor(self._node, self._node_name, "nav/odom", llh=True)
self._relative_odom_monitor = OdomMonitor(self._node, self._node_name, "nav/relative_pos/odom", llh=False)
self._filter_aiding_status_summary_monitor = FilterAidingMeasurementSummaryMonitor(self._node, self._node_name, "nav/aiding_summary")
self._gnss_1_aiding_status_monitor = GNSSAidingStatusMonitor(self._node, self._node_name, "gnss1/aiding_status")
self._gnss_2_aiding_status_monitor = GNSSAidingStatusMonitor(self._node, self._node_name, "gnss2/aiding_status")
self._gnss_dual_antenna_status_monitor = GNSSDualAntennaStatusMonitor(self._node, self._node_name, "nav/dual_antenna_status")
self._filter_status_monitor = FilterStatusMonitor(self._node, self._node_name, "nav/status", self._device_report_monitor)
self._relative_odom_monitor = OdomMonitor(self._node, self._node_name, "ekf/odometry_map", llh=False)
# self._filter_aiding_status_summary_monitor = FilterAidingMeasurementSummaryMonitor(self._node, self._node_name, "nav/aiding_summary")
# self._gnss_1_aiding_status_monitor = GNSSAidingStatusMonitor(self._node, self._node_name, "mip/ekf/gnss_position_aiding_status")
self._gnss_1_aiding_status_monitor = GNSSAidingStatusMonitor(self._node, self._node_name, "mip/gnss_1/aiding_status")
self._gnss_2_aiding_status_monitor = GNSSAidingStatusMonitor(self._node, self._node_name, "mip/gnss_2/aiding_status")
self._gnss_dual_antenna_status_monitor = GNSSDualAntennaStatusMonitor(self._node, self._node_name, "ekf/dual_antenna_status")
self._filter_status_monitor = FilterStatusMonitor(self._node, self._node_name, "ekf/status", self._device_report_monitor)

def run(self):
# Update data common to all sensors
Expand All @@ -41,7 +42,8 @@ def run(self):

# Update device specific data
if self._device_report_monitor.is_gq7:
self._update_aiding_measurements_data()
pass
# self._update_aiding_measurements_data()

def _update_filter_status_data(self):
self.filter_state_label.setText(self._filter_status_monitor.filter_state_string)
Expand Down
19 changes: 12 additions & 7 deletions src/microstrain_inertial_rqt/gnss_data.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from python_qt_binding.QtWidgets import QLabel

from .utils.widgets import MicrostrainWidget, MicrostrainPlugin
from .utils.subscribers import GNSSFixInfoMonitor, NavSatFixMonitor

Expand All @@ -11,10 +13,10 @@ def __init__(self, node):

def _configure(self):
# Set up the subscriber status monitors
self._gnss_1_fix_info_monitor = GNSSFixInfoMonitor(self._node, self._node_name, "gnss1/fix_info")
self._gnss_2_fix_info_monitor = GNSSFixInfoMonitor(self._node, self._node_name, "gnss2/fix_info")
self._gnss_1_nav_sat_fix_monitor = NavSatFixMonitor(self._node, self._node_name, "gnss1/fix")
self._gnss_2_nav_sat_fix_monitor = NavSatFixMonitor(self._node, self._node_name, "gnss2/fix")
self._gnss_1_fix_info_monitor = GNSSFixInfoMonitor(self._node, self._node_name, "mip/gnss_1/fix_info")
self._gnss_2_fix_info_monitor = GNSSFixInfoMonitor(self._node, self._node_name, "mip/gnss_2/fix_info")
self._gnss_1_nav_sat_fix_monitor = NavSatFixMonitor(self._node, self._node_name, "gnss_1/llh_position")
self._gnss_2_nav_sat_fix_monitor = NavSatFixMonitor(self._node, self._node_name, "gnss_2/llh_position")

# Hide the warning label
self.gnss_not_available_label.hide()
Expand Down Expand Up @@ -50,9 +52,12 @@ def _update_gnss_1_data(self):

def _update_gnss_2_data(self):
# Fix Info
self.gnss_2_fix_type_label.setText(self._gnss_2_fix_info_monitor.fix_type_string)
self.gnss_2_sv_count_label.setText(self._gnss_2_fix_info_monitor.num_sv_string)
self.gnss_2_position_uncertainty_label.setText(self._gnss_2_nav_sat_fix_monitor.position_uncertainty_string)
self.gnss_2_widget.findChild(QLabel,'gnss_2_fix_type_label')\
.setText(self._gnss_2_fix_info_monitor.fix_type_string)
self.gnss_2_widget.findChild(QLabel,'gnss_2_sv_count_label')\
.setText(self._gnss_2_fix_info_monitor.num_sv_string)
self.gnss_2_widget.findChild(QLabel,'gnss_2_position_uncertainty_label')\
.setText(self._gnss_2_nav_sat_fix_monitor.position_uncertainty_string)


class GNSSDataPlugin(MicrostrainPlugin):
Expand Down
8 changes: 4 additions & 4 deletions src/microstrain_inertial_rqt/gq7_led.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ def __init__(self, node):

def _configure(self):
# Set up the subscriber status monitors
self._gnss_1_aiding_status_monitor = GNSSAidingStatusMonitor(self._node, self._node_name, "gnss1/aiding_status")
self._gnss_2_aiding_status_monitor = GNSSAidingStatusMonitor(self._node, self._node_name, "gnss2/aiding_status")
self._filter_status_monitor = FilterStatusMonitor(self._node, self._node_name, "nav/status", self._device_report_monitor)
self._gnss_1_aiding_status_monitor = GNSSAidingStatusMonitor(self._node, self._node_name, "mip/gnss_1/aiding_status")
self._gnss_2_aiding_status_monitor = GNSSAidingStatusMonitor(self._node, self._node_name, "mip/gnss_2/aiding_status")
self._filter_status_monitor = FilterStatusMonitor(self._node, self._node_name, "ekf/status", self._device_report_monitor)

# Set up a special monitor for the GQ7 LED
self._gq7_led_monitor = GQ7LedMonitor(self._filter_status_monitor, self._gnss_1_aiding_status_monitor, self._gnss_2_aiding_status_monitor)
Expand All @@ -36,7 +36,7 @@ def run(self):
self._update_gq7_led()

def _update_gq7_led(self):
self.gq7_led_status_label.setText(self._filter_status_monitor.filter_state_led_string)
self.gq7_led_status_label.setText(self._filter_status_monitor.filter_state_string)
self.gq7_led_icon_label.setText(self._gq7_led_monitor.gq7_led_icon)


Expand Down
33 changes: 4 additions & 29 deletions src/microstrain_inertial_rqt/rtk_status.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .utils.widgets import MicrostrainWidget, MicrostrainPlugin
from .utils.subscribers import RTKMonitor, RTKMonitorV1
from .utils.subscribers import RTKMonitor

_WIDGET_NAME = 'RTKStatus'

Expand All @@ -11,8 +11,7 @@ def __init__(self, node):

def _configure(self):
# Set up the subscriber status monitors
self._rtk_status_monitor_v1 = RTKMonitorV1(self._node, self._node_name, "rtk/status_v1")
self._rtk_status_monitor = RTKMonitor(self._node, self._node_name, "rtk/status")
self._rtk_status_monitor = RTKMonitor(self._node, self._node_name, "mip/gnss_corrections/rtk_corrections_status")

# Hide the warning label
self.rtk_not_available_label.hide()
Expand All @@ -29,32 +28,7 @@ def run(self):
self.rtk_widget.show()

# Update device specific data
# If v1 dongle is connected, _rtk_status_monitor.version will be 0 or None and _rtk_status_monitor_v1.version will be 0
if self._rtk_status_monitor.version != 1 and self._rtk_status_monitor_v1.version == 0:
self.rtk_v1_widget.show()
self.rtk_v2_widget.hide()

self._update_rtk_data_v1()
# Default to v2
else:
self.rtk_v2_widget.show()
self.rtk_v1_widget.hide()

self._update_rtk_data_v2()

def _update_rtk_data_v1(self):
# V1 Status Flags
self.rtk_status_flags_mode_label.setText(self._rtk_status_monitor_v1.controller_state_string)
self.rtk_status_flags_controller_status_label.setText(self._rtk_status_monitor_v1.controller_status_string)
self.rtk_status_flags_device_state_label.setText(self._rtk_status_monitor_v1.platform_state_string)
self.rtk_status_flags_connection_status_label.setText(self._rtk_status_monitor_v1.platform_status_string)
self.rtk_status_flags_reset_reason_label.setText(self._rtk_status_monitor_v1.reset_reason_string)

# V1 Controller state icon label
self.rtk_led_status_label.setText(self._rtk_status_monitor_v1.controller_status_string)

# Update common flags
self._update_rtk_data(self._rtk_status_monitor_v1)
self._update_rtk_data_v2()

def _update_rtk_data_v2(self):
# V2 Status Flags
Expand All @@ -74,6 +48,7 @@ def _update_rtk_data_v2(self):
# Update common flags
self._update_rtk_data(self._rtk_status_monitor)

# TODO: Merge into one function
def _update_rtk_data(self, rtk_monitor):
# Epoch Status flags
self.rtk_corrections_received_gps_label.setText(rtk_monitor.gps_received_string)
Expand Down
16 changes: 9 additions & 7 deletions src/microstrain_inertial_rqt/utils/services.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from threading import Thread

from microstrain_inertial_msgs.srv import DeviceReport
from microstrain_inertial_msgs.srv import MipBaseGetDeviceInformation

from .common import ServiceMonitor
from .constants import _MICROSTRAIN_ROS_VERISON
Expand All @@ -9,7 +9,9 @@
class DeviceReportMonitor(ServiceMonitor):

def __init__(self, node, node_name):
super(DeviceReportMonitor, self).__init__(node, node_name, "device_report", DeviceReport, message_timeout=25, poll_interval=5)
# super(DeviceReportMonitor, self).__init__(node, node_name, "device_report", \
super(DeviceReportMonitor, self).__init__(node, node_name, "mip/base/get_device_information", \
MipBaseGetDeviceInformation, message_timeout=25, poll_interval=5)

# Keep track of some booleans so that we can keep track between disconnects
self._is_gq7 = False
Expand All @@ -24,23 +26,23 @@ def connected(self):

@property
def model_name(self):
return self._get_val(self._current_message.model_name)
return self._get_val(self._current_message.device_info.model_name)

@property
def model_number(self):
return self._get_val(self._current_message.model_number)
return self._get_val(self._current_message.device_info.model_number)

@property
def serial_number(self):
return self._get_val(self._current_message.serial_number)
return self._get_val(self._current_message.device_info.serial_number)

@property
def options(self):
return self._get_val(self._current_message.options)
return self._get_val(self._current_message.device_info.device_options)

@property
def firmware_version(self):
return self._get_val(self._current_message.firmware_version)
return self._get_val(self._current_message.device_info.firmware_version)

@property
def is_gq7(self):
Expand Down
Loading