example packages

This commit is contained in:
2025-05-24 19:00:57 -04:00
parent 2c8043db4f
commit a5b75ddfd5
14 changed files with 44 additions and 109 deletions

View File

@@ -1,82 +0,0 @@
-- brsoa_system_config.lua
-- Global configuration
global_config = {
max_nodes = 50,
discovery_method = "broadcast",
system_name = "example_system",
log_level = "debug"
}
-- Define nodes to be launched
nodes = {
{
name = "example_node_cpp",
package = "example_package_cpp",
executable = "example_driver_cpp",
language = "cpp",
args = {"--fps=30"},
env = {SENSOR_TYPE = "lidar"}
},
{
name = "example_node_py",
package = "example_package_py",
executable = "example_package_py.py",
language = "python",
args = {"--algorithm=detection"},
env = {PYTHONPATH = "${WORKSPACE}/lib:${WORKSPACE}/include"}
},
{
name = "example_node_java",
package = "example_ui_package_java",
executable = "ExampleDisplayAppJava",
language = "java",
args = {"--resolution=720p"},
env = {JAVA_OPTS = "-Xmx1g"}
},
{
name = "example_node_rust",
package = "example_package_rust",
executable = "example_package_rust",
language = "rust",
args = {"--mode=manual"},
env = {RUST_BACKTRACE = "1"}
},
{
name = "example_node_bridge_go",
package = "example_package_go",
executable = "example_package_go",
language = "go",
args = {"--port=9090"},
env = {GOMAXPROCS = "2"}
}
}
-- Define communication setup
topics = {
{
name = "/example/example",
type = "Example",
queue_size = 5,
publishers = {"example_node"},
subscribers = {"example1", "example2"}
}
}
-- Define services
services = {
{
name = "/example/example",
type = "Example",
server = "example_server",
clients = {"example_client"}
}
}
-- Define parameters
parameters = {
{
name = "/example/example",
type = "string",
value = global_config.system_name
}
}

View File

@@ -3,19 +3,19 @@
#include <chrono>
#include <thread>
class Example_package {
class Example_cpp {
public:
void run() {
while (true) {
// TODO: Implement node logic
std::cout << "Running example_package" << std::endl;
std::cout << "Running example_cpp" << std::endl;
std::this_thread::sleep_for(std::chrono::seconds(1));
}
}
};
int main(int argc, char** argv) {
Example_package node;
Example_cpp node;
node.run();
return 0;
}

View File

@@ -0,0 +1,4 @@
dependencies:
- common_msgs
language: cpp
name: ../exampleexample_cpp

View File

@@ -6,17 +6,17 @@ import (
"common_msgs"
)
type Example_package struct{}
type Example_go struct{}
func (n *Example_package) Run() {
func (n *Example_go) Run() {
for {
// TODO: Implement node logic
fmt.Println("Running example_package")
fmt.Println("Running example_go")
time.Sleep(1 * time.Second)
}
}
func main() {
node := &Example_package{}
node := &Example_go{}
node.Run()
}

View File

@@ -1,4 +1,4 @@
dependencies:
- common_msgs
language: go
name: example_package
name: ../exampleexample_go

View File

@@ -1,10 +1,10 @@
import common_msgs.Messages.*;
public class Example_package {
public class Example_java {
public void run() {
while (true) {
// TODO: Implement node logic
System.out.println("Running example_package");
System.out.println("Running example_java");
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
@@ -14,7 +14,7 @@ public class Example_package {
}
public static void main(String[] args) {
Example_package node = new Example_package();
Example_java node = new Example_java();
node.run();
}
}

View File

@@ -0,0 +1,4 @@
dependencies:
- common_msgs
language: java
name: ../exampleexample_java

View File

@@ -1,13 +1,13 @@
from common_msgs import *
import time
class Example_package:
class Example_python:
def run(self):
while True:
# TODO: Implement node logic
print(f"Running example_package")
print(f"Running example_python")
time.sleep(1)
if __name__ == "__main__":
node = Example_package()
node = Example_python()
node.run()

View File

@@ -0,0 +1,4 @@
dependencies:
- common_msgs
language: python
name: ../exampleexample_python

View File

@@ -1,5 +1,5 @@
[package]
name = "example_package"
name = "example_rust"
version = "0.1.0"
edition = "2021"

View File

@@ -1,19 +1,19 @@
use common_msgs::*;
use std::{thread, time};
struct Example_package;
struct Example_rust;
impl Example_package {
impl Example_rust {
fn run(&self) {
loop {
// TODO: Implement node logic
println!("Running example_package");
println!("Running example_rust");
thread::sleep(time::Duration::from_secs(1));
}
}
}
fn main() {
let node = Example_package{};
let node = Example_rust{};
node.run();
}

View File

@@ -0,0 +1,4 @@
dependencies:
- common_msgs
language: rust
name: ../exampleexample_rust