Compare commits

..

4 Commits

Author SHA1 Message Date
7612cab494 latest pushes 2025-08-17 11:19:12 -04:00
cfb33e9006 latest pushes 2025-08-04 17:49:41 -04:00
c99ba07426 latest pushes 2025-04-19 10:34:15 -04:00
274ece33af latest pushes 2025-04-14 12:41:44 -04:00
12 changed files with 50 additions and 196 deletions

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "bellande_step" name = "bellande_step"
version = "0.1.0" version = "0.1.2"
edition = "2021" edition = "2021"
authors = ["Bellande Robotics Sensors Research Innovation Center"] authors = ["Bellande Robotics Sensors Research Innovation Center"]
description = "A tool for running Bellande Step calculations via API or local executable" description = "A tool for running Bellande Step calculations via API or local executable"
@@ -12,12 +12,8 @@ categories = ["science", "algorithms"]
[dependencies] [dependencies]
reqwest = { version = "0.11", features = ["json"] } reqwest = { version = "0.11", features = ["json"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
structopt = "0.3" structopt = "0.3"
tokio = { version = "1.0", features = ["full"] }
thiserror = "1.0"
anyhow = "1.0"
[lib] [lib]
name = "bellande_step" name = "bellande_step"

View File

@@ -2,3 +2,4 @@ cp ../../README.md .
bash ../../git_scripts/push.sh bash ../../git_scripts/push.sh
cargo publish cargo publish
rm -f README.md rm -f README.md
cargo clean

View File

@@ -17,7 +17,7 @@ use reqwest;
use serde_json::{json, Value}; use serde_json::{json, Value};
use std::error::Error; use std::error::Error;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::{self, Command}; use std::process::Command;
use structopt::StructOpt; use structopt::StructOpt;
#[derive(StructOpt, Debug)] #[derive(StructOpt, Debug)]
@@ -39,7 +39,7 @@ struct Opt {
use_executable: bool, use_executable: bool,
} }
async fn make_bellande_step_request( pub async fn make_bellande_step_request(
node0: Value, node0: Value,
node1: Value, node1: Value,
limit: i32, limit: i32,
@@ -71,17 +71,48 @@ async fn make_bellande_step_request(
Ok(response) Ok(response)
} }
fn get_executable_path() -> PathBuf { pub async fn make_bellande_step_request_local(
url: &str,
node0: Value,
node1: Value,
limit: i32,
dimensions: i32,
) -> Result<Value, Box<dyn Error>> {
let client = reqwest::Client::new();
let url = url;
let payload = json!({
"node0": node0,
"node1": node1,
"limit": limit,
"dimensions": dimensions,
"auth": {
"authorization_key": "bellande_web_api_opensource"
}
});
let response = client
.post(url)
.header("accept", "application/json")
.header("Content-Type", "application/json")
.json(&payload)
.send()
.await?
.json::<Value>()
.await?;
Ok(response)
}
pub fn get_executable_path() -> PathBuf {
if cfg!(target_os = "windows") { if cfg!(target_os = "windows") {
Path::new(env!("CARGO_MANIFEST_DIR")) Path::new(env!("CARGO_MANIFEST_DIR")).join("Bellande_Step.exe")
.join("Bellande_Step.exe")
} else { } else {
Path::new(env!("CARGO_MANIFEST_DIR")) Path::new(env!("CARGO_MANIFEST_DIR")).join("Bellande_Step")
.join("Bellande_Step")
} }
} }
fn run_bellande_step_executable( pub fn run_bellande_step_executable(
node0: &str, node0: &str,
node1: &str, node1: &str,
limit: i32, limit: i32,
@@ -119,43 +150,7 @@ fn run_bellande_step_executable(
Err(format!( Err(format!(
"Process failed: {}", "Process failed: {}",
String::from_utf8_lossy(&output.stderr) String::from_utf8_lossy(&output.stderr)
).into()) )
.into())
} }
} }
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let opt = Opt::from_args();
// Parse JSON strings to Values for validation
let node0: Value = serde_json::from_str(&opt.node0)
.map_err(|e| format!("Error parsing node0: {}", e))?;
let node1: Value = serde_json::from_str(&opt.node1)
.map_err(|e| format!("Error parsing node1: {}", e))?;
if opt.use_executable {
// Run using local executable
if let Err(e) = run_bellande_step_executable(
&opt.node0,
&opt.node1,
opt.limit,
opt.dimensions,
) {
eprintln!("Error: {}", e);
process::exit(1);
}
} else {
// Run using API
match make_bellande_step_request(node0, node1, opt.limit, opt.dimensions).await {
Ok(result) => {
println!("{}", serde_json::to_string_pretty(&result)?);
}
Err(e) => {
eprintln!("Error: {}", e);
process::exit(1);
}
}
}
Ok(())
}

View File

@@ -2,12 +2,12 @@
![Demo GIF](bellande_step_api_package.gif) ![Demo GIF](bellande_step_api_package.gif)
## Preprint ## Published Paper
- [![Preprint](https://img.shields.io/badge/Preprint-Bellande%20Step-0099cc?style=for-the-badge)](https://dapp.orvium.io/deposits/6650ccb8afb407dc8beb0ff2/view) - [![Published Paper](https://img.shields.io/badge/Published-Paper-Bellande%20Step-0099cc?style=for-the-badge)](https://dapp.orvium.io/deposits/68587a985eeed4f3763b0c12/view)
# Preprint Citation # Published Citation
``` ```
Bellande, R. (2024). Efficient Step Function for Infinite Multi-Dimensional Node Calculation within Model-Integrated Dimensional Space [version 1] [preprint]. Mathematics. Bellande, R. (2025). Efficient Step Function for Infinite Multi-Dimensional Node Calculation within Model-Integrated Dimensional Space [version 1]. Robotics.
``` ```
@@ -167,22 +167,15 @@ curl -X 'POST' \
``` ```
Name: bellande_robot_step Name: bellande_robot_step
Version: 0.3.0
Summary: Computes the next step towards a target node Summary: Computes the next step towards a target node
Home-page: github.com/RonaldsonBellande/bellande_robot_step Home-page: github.com/Robotics-Sensors/bellande_robot_step
Author: Ronaldson Bellande Author: Ronaldson Bellande
Author-email: ronaldsonbellande@gmail.com Author-email: ronaldsonbellande@gmail.com
License: GNU General Public License v3.0 License: GNU General Public License v3.0
Required-by:
``` ```
## Published Paper ## Published Paper
``` - [![Published Paper](https://img.shields.io/badge/Published-Paper-Bellande%20Step-0099cc?style=for-the-badge)](https://dapp.orvium.io/deposits/68587a985eeed4f3763b0c12/view)
Coming Soon
```
## Preprint
- [![Preprint](https://img.shields.io/badge/Preprint-Bellande%20Step-0099cc?style=for-the-badge)](https://dapp.orvium.io/deposits/6650ccb8afb407dc8beb0ff2/view)
## License ## License

BIN
bellande_step.pdf Normal file

Binary file not shown.

View File

@@ -0,0 +1 @@
cp ~/Desktop/Resources_Documents/research_journal_paper_book_legal_resources/bellande_research_papers/bellande_step/bellande_step.pdf .

View File

@@ -1,21 +0,0 @@
# Copyright (C) 2024 Bellande Robotics Sensors Research Innovation Center, Ronaldson Bellande
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# GNU General Public License v3.0 or later
url: https://bellande-robotics-sensors-research-innovation-center.org
endpoint_path:
bellande_step: /api/Bellande_Step/bellande_step
Bellande_Framework_Access_Key: bellande_web_api_opensource

View File

@@ -1,21 +0,0 @@
# Copyright (C) 2024 Bellande Robotics Sensors Research Innovation Center, Ronaldson Bellande
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# GNU General Public License v3.0 or later
url: tcp://bellande-robotics-sensors-research-innovation-center.org
endpoint_path:
bellande_step: /api/Bellande_Step/bellande_step
Bellande_Framework_Access_Key: bellande_web_api_opensource

View File

@@ -1,21 +0,0 @@
# Copyright (C) 2024 Bellande Robotics Sensors Research Innovation Center, Ronaldson Bellande
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# GNU General Public License v3.0 or later
url: tls://bellande-robotics-sensors-research-innovation-center.org
endpoint_path:
bellande_step: /api/Bellande_Step/bellande_step
Bellande_Framework_Access_Key: bellande_web_api_opensource

View File

@@ -1,23 +0,0 @@
{
"license": [
"Copyright (C) 2024 Bellande Robotics Sensors Research Innovation Center, Ronaldson Bellande",
"This program is free software: you can redistribute it and/or modify",
"it under the terms of the GNU General Public License as published by",
"the Free Software Foundation, either version 3 of the License, or",
"(at your option) any later version.",
"",
"This program is distributed in the hope that it will be useful,",
"but WITHOUT ANY WARRANTY; without even the implied warranty of",
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
"GNU General Public License for more details.",
"",
"You should have received a copy of the GNU General Public License",
"along with this program. If not, see <https://www.gnu.org/licenses/>.",
"GNU General Public License v3.0 or later"
],
"url": "https://bellande-robotics-sensors-research-innovation-center.org",
"endpoint_path": {
"bellande_step": "/api/Bellande_Step/bellande_step_nd"
},
"Bellande_Framework_Access_Key": "bellande_web_api_opensource"
}

View File

@@ -1,23 +0,0 @@
{
"license": [
"Copyright (C) 2024 Bellande Robotics Sensors Research Innovation Center, Ronaldson Bellande",
"This program is free software: you can redistribute it and/or modify",
"it under the terms of the GNU General Public License as published by",
"the Free Software Foundation, either version 3 of the License, or",
"(at your option) any later version.",
"",
"This program is distributed in the hope that it will be useful,",
"but WITHOUT ANY WARRANTY; without even the implied warranty of",
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
"GNU General Public License for more details.",
"",
"You should have received a copy of the GNU General Public License",
"along with this program. If not, see <https://www.gnu.org/licenses/>.",
"GNU General Public License v3.0 or later"
],
"url": "tcp://bellande-robotics-sensors-research-innovation-center.org",
"endpoint_path": {
"bellande_step": "/tcp/Bellande_Step/bellande_step_nd"
},
"Bellande_Framework_Access_Key": "bellande_tcp_api_opensource"
}

View File

@@ -1,23 +0,0 @@
{
"license": [
"Copyright (C) 2024 Bellande Robotics Sensors Research Innovation Center, Ronaldson Bellande",
"This program is free software: you can redistribute it and/or modify",
"it under the terms of the GNU General Public License as published by",
"the Free Software Foundation, either version 3 of the License, or",
"(at your option) any later version.",
"",
"This program is distributed in the hope that it will be useful,",
"but WITHOUT ANY WARRANTY; without even the implied warranty of",
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
"GNU General Public License for more details.",
"",
"You should have received a copy of the GNU General Public License",
"along with this program. If not, see <https://www.gnu.org/licenses/>.",
"GNU General Public License v3.0 or later"
],
"url": "tls://bellande-robotics-sensors-research-innovation-center.org",
"endpoint_path": {
"bellande_step": "/tls/Bellande_Step/bellande_step_nd"
},
"Bellande_Framework_Access_Key": "bellande_tls_api_opensource"
}