-
Notifications
You must be signed in to change notification settings - Fork 1
GUI
GUI for the AUV’s telemetry based information with three tabs/frames-
- TELEMETRY
- CONTROLLER
- BOTTOM CAMERA
The gui.py file imports gui components from the ControllerUI, TelemetryUI and VisionUI directories and places them in corresponding tabs.
depthActionUI.py
Creating UI component consisting of an input field where we enter the newDepthInput value and a button that calls a function that implements threading to set up an action client with namespace ‘depthServer’ and depth.action containing the goal, result and feedback definitions.
-
Next, waiting to connect with depthServer,
-
Creating a goal that contains the input field value (newDepthInput) and sending the goal.
-
Waiting for result and then printing it to the gui.
headingActionUI.py
Creating UI component consisting of an input field where we enter the newHeadingInput value and a button that calls a function that implements threading to set up an action client with namespace ‘headingServer’ and heading.action containing the goal, result and feedback definitions.
-
Next, waiting to connect with headingServer,
-
Creating a goal that contains the input field value (newHeadingInput) and sending the goal.
-
Waiting for result and then printing it to the gui.
angularVelocityUI.py
Creating UI component consisting of 3 text fields for x,y and z angular velocities; initialising them with ‘X’,’Y’ and ‘Z’.
Subscribing to the /imu/data topic to which the Sparton IMU is publishing corresponding angular velocities.
Callback function of the subscriber rounding off and updating the text fields with x,y and z values.
linearAccelerationUI.py
Creating UI component consisting of 3 text fields for x,y and z linear acceleration; initialising them with ‘X’,’Y’ and ‘Z’.
-
Subscribing to the /imu/data topic to which the Sparton IMU is publishing corresponding linear accelerations.
-
Callback function of the subscriber rounding off and updating the text fields with x,y and z values.
orientationUI.py
Creating UI component consisting of 4 text fields for orientation angles (in degrees) along x,y,z,w.
-
Subscribing to the /imu/data topic to which the Sparton IMU is publishing corresponding orientation angles.
-
Callback function of the subscriber rounding off and updating the text fields with x,y,z and w values.
pidUI.py
Creating UI component consisting of 6 text fields for proportional gain constants pKp, pKi, pKd and hKp, hKi, hKd2.
-
Subscribing to the /pressurePID and /headingPID topics
-
Callback function of the subscriber updating the text fields with values.
pressureUI.py
Creating UI component consisting of 6 text fields for proportional gain constants pKp, pKi, pKd and hKp, hKi, hKd2.
-
Subscribing to the /pressurePID and /headingPID topics
-
Callback function of the subscriber updating the pressure text field value. * //to be converted to depth asap
thrusterUI.py
Creating UI component consisting of 8 text fields for 2 forward thrusters, 4 depth thrusters and 2 direction thrusters; initialising/filling them with some text.
-
Subscribing to the /thruster topics to which the controller.cpp node is publishing.
-
Callback function of the subscriber rounding off and updating the text fields with thruster speed values.
video.py
Creating a reusable UI grid component that has a ‘Snapshot’ button and a view to render video feed.
This constructor function takes in params such as ‘frameVideo’, ’topic’, ‘row’, ‘column’ and frame text as ‘name’.Subscribing to the topic that is passed as an argument.
Corresponding callback function image_cb() which is-
- converting a ROS image message into an cv::Mat
- converting BGR to RGB format, resizing and converting video feed frame array to image using Pillow library.
- rendering feed to the view.
And takeSnapshot() function attached to snapshot button that saves the captured image with name as date and time.
bottomCamUI.py
-
Importing video.py file, using its constructor function to create two frame boxes, one being ‘Raw image’, subscribing to /alpheus_cam/bottom/image_raw topic and the other being ‘Processed image’, subscribing to /alpheus_cam/bottom/image_processed topic.
-
The raw image video feed is being published by the USB cam, the parameters of which are stored in the bottom_cam.launch file in the launch package.
frontCamUI.py
-
Importing video.py file, using its constructor function to create two frame boxes one being ‘Raw image’, subscribing to /alpheus_cam/front/image_raw topic and the other being ‘Processed image’, subscribing to /front/gate topic.
-
The front USB cam is publishing to the former topic whereas the front_cam.py node in the vision package is publishing the gate-detected feed to the latter topic.
hsvDynClient.py
-
This node is essentially a GUI component that allows dynamic reconfiguration of the H(Hue), S(Saturation) and V(Value) values allowing us to implement better color based object detection.
-
Red and green checkboxes allow us to be able to implement detection of either of the respective colors based on their H,S,V values.
-
Six sliders mapping Hue-Min,Max , Saturation-Min,Max and Lightness-Min,Max value ranges.