-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
612 additions
and
72 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,33 @@ | ||
use optima_bevy::optima_bevy_utils::robotics::BevyRoboticsTrait; | ||
use optima_robotics::robot::ORobotDefault; | ||
use std::sync::{Arc, Mutex}; | ||
use bevy::app::App; | ||
use bevy::DefaultPlugins; | ||
use bevy::prelude::{Res, Time, Update}; | ||
use optima_robotics::robot::{ORobotDefault}; | ||
|
||
fn test(robot: &Arc<ORobotDefault>, time: &Res<Time>, a: &Arc<Mutex<i32>>) { | ||
let mut binding = a.lock().unwrap(); | ||
*binding += 1; | ||
println!("{:?}, {:?}, {:?}", robot.num_dofs(), time.elapsed(), binding); | ||
} | ||
|
||
fn test2(robot: &Arc<ORobotDefault>, a: &Arc<Mutex<i32>>) { | ||
println!("{:?}, {:?}", robot.get_dof_upper_bounds(), a); | ||
} | ||
|
||
fn main() { | ||
let r = ORobotDefault::load_from_saved_robot("ur5"); | ||
r.bevy_display(); | ||
let r1 = Arc::new(r); | ||
let r2 = r1.clone(); | ||
let a = Arc::new(Mutex::new(1)); | ||
let b = a.clone(); | ||
|
||
let mut app = App::new(); | ||
app.add_plugins(DefaultPlugins); | ||
app.add_systems(Update, move |time: Res<Time>| { | ||
test(&r1, &time, &a); | ||
}); | ||
app.add_systems(Update, move || { | ||
test2(&r2, &b); | ||
}); | ||
app.run(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use bevy::app::{App, Startup}; | ||
use bevy::asset::{Assets, AssetServer}; | ||
use bevy::pbr::StandardMaterial; | ||
use bevy::prelude::{Commands, Mesh, Res, ResMut}; | ||
use nalgebra::{Isometry3, Vector3}; | ||
use parry_ad::shape::Cuboid; | ||
use optima_bevy::optima_bevy_utils::shape_scene::{ShapeSceneActions, ShapeSceneType}; | ||
use optima_bevy::OptimaBevyTrait; | ||
use optima_proximity::shape_scene::OParryGenericShapeScene; | ||
use optima_proximity::shapes::OParryShape; | ||
use optima_robotics::robot::ORobotDefault; | ||
|
||
fn main() { | ||
let r = ORobotDefault::from_urdf("ur5"); | ||
// let g = OParryGenericShapeScene::new(vec![OParryShape::new(Cuboid::new(Vector3::new(0.1,0.1,0.01)), Isometry3::identity())], vec![Isometry3::identity()]); | ||
|
||
let mut app = App::new(); | ||
app.optima_bevy_starter_scene(); | ||
app.add_systems(Startup, move |mut commands: Commands, asset_server: Res<AssetServer>, mut meshes: ResMut<Assets<Mesh>>, mut materials: ResMut<Assets<StandardMaterial>>| { | ||
ShapeSceneActions::action_spawn_shape_scene::<_, _, Vec<_>, _>(&r, &vec![0.0; 6], ShapeSceneType::Robot, &mut commands, &asset_server, &mut meshes, &mut materials); | ||
}); | ||
app.run(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.