Skip to content

Commit

Permalink
sim - backend - dynobench: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
whoenig committed Jan 18, 2024
1 parent 7be73c4 commit e28a9f2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
15 changes: 15 additions & 0 deletions crazyflie_sim/crazyflie_sim/backend/data/dynobench/crazyflie2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# distance_weights: [1. , .5, .2, .2 ]
distance_weights: [1., .5, .1, .05]
max_vel: 4
max_angular_vel: 8
max_acc: 25 # used for bounds on time
max_angular_acc: 20 # used for bounds on time
motor_control: true # True = controls are forces in the motors (False is NOT implemented)
m: 0.034
max_f: 1.3
arm_length: 0.046
t2t: 0.006 # thrust-to-torque ratio
J_v: [16.571710e-6, 16.655602e-6, 29.261652e-6] # inertia matrix
dt: .01
size: [.25]
dynamics: quad3d
6 changes: 2 additions & 4 deletions crazyflie_sim/crazyflie_sim/backend/dynobench.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from __future__ import annotations
from pathlib import Path

import numpy as np
from rclpy.node import Node
Expand Down Expand Up @@ -85,7 +85,7 @@ class Quadrotor:

def __init__(self, state):
self.uav = robot_python.robot_factory(
'/home/whoenig/projects/dynobench/models/quad3d_v0.yaml', [], [])
str((Path(__file__).parent / 'data/dynobench/crazyflie2.yaml').resolve()), [], [])
self.state = state

def step(self, action, dt):
Expand All @@ -96,8 +96,6 @@ def step(self, action, dt):
normalized_force = force_in_newton / (1.3 * (0.034 / 4) * 9.81)

xnext = np.zeros(13)
# print(sim_state2dynobench_state(self.state))
print(normalized_force)
self.uav.step(xnext, sim_state2dynobench_state(self.state), normalized_force, dt)
self.state = dynobench_state2sim_state(xnext)

Expand Down

0 comments on commit e28a9f2

Please sign in to comment.