Skip to content

Commit

Permalink
Merge pull request #50 from MO-RISE/msg/config-msg
Browse files Browse the repository at this point in the history
MCAP recorder updated with query to storage
  • Loading branch information
TedSjoblom authored Jun 4, 2024
2 parents c13f1c3 + 0b44cef commit 04454ba
Show file tree
Hide file tree
Showing 14 changed files with 116 additions and 174 deletions.
9 changes: 8 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pip3 install --user -r requirements_dev.txt -r requirements_connectors.txt"
"postCreateCommand": "pip3 install --user -r requirements_dev.txt -r requirements_connectors.txt",
"customizations": {
"vscode": {
"extensions": [
"zxh404.vscode-proto3"
]
}
}
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
2 changes: 1 addition & 1 deletion connectors/mcap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ docker run ghcr.io/mo-rise/keelson:0.3.4 "mcap-record -h"

# Record
# Crete an reccording folder before running, for this example "mkdir rec_mcap"
docker run --network host --volume /home/user/rec_mcap:/rec_mcap ghcr.io/mo-rise/keelson:0.3.4 "mcap-record --output rec_mcap/2024-05-15.mcap -k rise/v0/masslab/pubsub/**"
docker run --network host --volume /home/user/rec_mcap:/rec_mcap ghcr.io/mo-rise/keelson:0.3.4 "mcap-record --output rec_mcap/2024-05-15.mcap -k rise/v0/masslab/pubsub/**" -k new/key
```

## mcap-replay
Expand Down
19 changes: 17 additions & 2 deletions connectors/mcap/bin/mcap-record
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ from mcap.writer import Writer
from mcap.well_known import SchemaEncoding, MessageEncoding
from google.protobuf.message import DecodeError


import keelson

logger = logging.getLogger("mcap-record")
Expand Down Expand Up @@ -66,7 +65,6 @@ def run(session: zenoh.Session, args: argparse.Namespace):
close_down = Event()

def _recorder():

if args.output_path:
source_path = (
pathlib.Path(args.output_path)
Expand Down Expand Up @@ -173,6 +171,23 @@ def run(session: zenoh.Session, args: argparse.Namespace):
t.daemon = True
t.start()

for key in args.key:
logger.info("Getting data from key-storage: %s", key)

logger.debug("Query key: %s", key)
replies = session.get(
key, zenoh.Queue(), consolidation=zenoh.QueryConsolidation.NONE()
)

for reply in replies.receiver:
try:
logger.info("Query processing key '%s'", reply.ok.key_expr)
queue.put(reply.ok)
except Exception as e:
logger.info("No keys found in GET! {e}")

lambda: logger.info("Finnished getting data from key-storage!"),

# And start subscribing
subscribers = [session.declare_subscriber(key, queue.put) for key in args.key]

Expand Down
3 changes: 0 additions & 3 deletions connectors/ouster/README.md

This file was deleted.

153 changes: 0 additions & 153 deletions connectors/ouster/bin/ouster

This file was deleted.

3 changes: 0 additions & 3 deletions connectors/ouster/requirements.txt

This file was deleted.

16 changes: 15 additions & 1 deletion messages/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Messages

TODO...
In the folder messages are the defections for subjects and messages

## Add or Edit Message payloads

Each message is wrapped in an [Envelope](./Envelope.proto) with include the payload message and all the payloads are located in the [payloads folder](./payloads/). Each payload is an protobuf definition as the file type .proto

Messages are divided into the following packages:
- foxglove ([Foxglove formatdefintion](https://github.com/foxglove/schemas/tree/main/schemas/proto/foxglove))

Foxglove messages should be avoided to modify and if really

### To add

1) Just create a new proto file and name it descriptively in CamelCase.
2)
60 changes: 60 additions & 0 deletions messages/payloads/ConfigurationSensorPerception.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
syntax = "proto3";

import "google/protobuf/timestamp.proto";
import "LocationFix.proto";
import "Pose.proto";

package keelson.experimental;

// Configuration state descirbtion all is optional
message ConfigurationSensorPerception {

// Type of preseption sensor
enum SensorType {
UNKNOWN = 0;
CAMERA = 1;
LIDAR = 2;
RADAR_MARINE = 3;
RADAR_VEHICLE = 4;
}

// Timestamp of the message when it was created
google.protobuf.Timestamp timestamp = 1;

// Geografical location that shuch be static
foxglove.LocationFix location = 2;

// Sensor pose relative to the platfrom shuch be static
foxglove.Pose pose = 3;

// View fild of snsor in horizontal
float view_horizontal_angel_deg = 4;

// View fild starting point azimuth in horizontal
float view_horizontal_start_angel_deg = 5;

// View fild end point azimuth in horizontal
float view_horizontal_end_angel_deg = 6;

// View fild of snsor in vertical
float view_vertical_angel_deg = 7;

// Mode of the sensor
string mode = 8;

// Operation mode of the sensor (RUNNING, STANDBY, OFF)
enum mode_operating {
RUNNING = 0;
STANDBY = 1;
DISABLED = 2;
OFF = 3;
ERROR = 4;
}

string mode_timestamp = 9;

string other_json = 99;

}


6 changes: 3 additions & 3 deletions messages/payloads/SailControlState.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ package keelson.compound;

message SailControlState {

int32 sheeting_mode = 1; // (1= manual, 2= automatic)
int32 sheeting_mode = 1; // (1= manual mode and relative to bow , 2= automatic mode or relative to wind)

int32 coupled_steering_mode = 2; // (0=actvivated, 1=deactivated)
int32 coupled_steering_mode = 2; // (0=deactivated, 1=actvivated)

int32 variable_thrust_mode = 3; // (0=actvivated, 1=deactivated)
int32 variable_thrust_mode = 3; // (0=deactivated, 1=actvivated)

float variable_thrust_set_pct = 4; // (0.0 - 1.0 = 0% - 100%)

Expand Down
5 changes: 4 additions & 1 deletion messages/payloads/SailState.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ syntax = "proto3";

package keelson.compound;

// State of an single sail
message SailState {

int32 is_active_mode = 1; // (0=actvivated, 1=deactivated)
int32 is_active_mode = 1; // (0=deactivated, 1=actvivated)

float sheeting_angle_actual_deg = 2; // -180 to 180 degrees

float boom_angle_actual_deg = 9; // -180 to 180 degrees

float sheeting_angle_set_deg = 3; // Relative to bow as zero -180 port to 180 starbord in degrees

float sheeting_angle_add_deg = 8; // Relative to bow as zero -180 port to 180 starbord in degrees
Expand Down
5 changes: 4 additions & 1 deletion messages/subjects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,7 @@ flight_controller_telemetry_ahrs:
flight_controller_telemetry_vibration:
schema: keelson.experimental.Vibration
flight_controller_telemetry_battery:
schema: keelson.experimental.BatteryStatus
schema: keelson.experimental.BatteryStatus

configuration_perception_sensor:
schema: keelson.experimental.ConfigurationSensorPerception
1 change: 0 additions & 1 deletion requirements_connectors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
-r connectors/mediamtx/requirements.txt
-r connectors/mockups/requirements.txt
-r connectors/opendlv/requirements.txt
-r connectors/ouster/requirements.txt
-r connectors/rtsp/requirements.txt
2 changes: 1 addition & 1 deletion sdks/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "keelson-js",
"version": "0.3.5",
"version": "0.3.6",
"description": "",
"main": "index.js",
"files": [
Expand Down
6 changes: 3 additions & 3 deletions sdks/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def read(fname):

setup(
name="keelson",
version="0.3.5",
version="0.3.6",
license="Apache License 2.0",
description="A python Software Development Kit for keelson",
long_description=read("README.md"),
Expand All @@ -32,11 +32,11 @@ def read(fname):
packages=find_namespace_packages(exclude=["tests", "dist", "build"]),
python_requires=">=3.7",
install_requires=[
"eclipse-zenoh>=0.10.1-rc",
"eclipse-zenoh>=0.11.0rc3",
"protobuf",
"pyyaml",
"parse",
"zenoh-cli>=0.5.0",
# "zenoh-cli>=0.5.0",
],
include_package_data=True,
package_data={
Expand Down

0 comments on commit 04454ba

Please sign in to comment.