Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 16, 2024
1 parent 6b74691 commit 00aaca6
Show file tree
Hide file tree
Showing 31 changed files with 1,006 additions and 1,081 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $ conda env create -f rpc.yml
- [Foxglove](https://github.com/foxglove): websocket & schema protocols for robot visualization and parameter operations


## :computer: Usage
## :computer: Usage
#### (1) PyBullet
- Source conda environment:<br/>
```
Expand Down Expand Up @@ -56,7 +56,7 @@ $ make -j4
$ ./bin/run_draco
```
#### Keyboard Input
- Please see the [example implementation](https://github.com/shbang91/rpc/blob/develop/controller/draco_controller/draco_interrupt_handler.cpp) for DRACO 3
- Please see the [example implementation](https://github.com/shbang91/rpc/blob/develop/controller/draco_controller/draco_interrupt_handler.cpp) for DRACO 3

## :tv: Visualization
#### (1) Foxglove UI (optional)
Expand Down
2 changes: 1 addition & 1 deletion binding/pycontroller/optimo_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pybind11_add_module(optimo_interface_py optimo_interface_pybind_pin.cpp)
target_link_libraries(optimo_interface_py PUBLIC rpc-optimo-controller)
target_link_libraries(optimo_interface_py PUBLIC rpc-optimo-controller)
8 changes: 4 additions & 4 deletions config/go2/sim/pybullet/wbic/pnc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ stance_foot: 1 # 0: left_foot 1: right_foot

state_estimator:
b_cheater_mode: true ## true: use simulation groundtruth states
state_estimator_type: kf ## 1. default (IMU + Leg kinematics) 2. kf
state_estimator_type: kf ## 1. default (IMU + Leg kinematics) 2. kf
b_use_marg_filter: false # only used when kf is set to true

foot_reference_frame: 1 #0: left foot, 1: right foot
Expand All @@ -34,7 +34,7 @@ state_estimator:
num_data_com_vel: [10, 10, 10]

## IF 1: exponential smoother filter parameter
#com_vel_time_constant: 0.1
#com_vel_time_constant: 0.1
com_vel_time_constant: 0.01
com_vel_err_limit: [1., 1., 1.]

Expand All @@ -43,7 +43,7 @@ state_estimator:


controller:
b_smoothing_command: true
b_smoothing_command: true
smoothing_command_duration: 0.01 ## this will filter the control command at the beginning
b_use_modified_swing_foot_jac: true
b_use_filtered_torque: false
Expand Down Expand Up @@ -102,7 +102,7 @@ wbc:
mu: 0.5
foot_half_length: 0.08
foot_half_width: 0.04 ## 0.04
kp: [0, 0, 0, 0, 0, 0] ## ori, pos order
kp: [0, 0, 0, 0, 0, 0] ## ori, pos order
kd: [0, 0, 0, 0, 0, 0]

qp:
Expand Down
71 changes: 62 additions & 9 deletions config/go2/sim/pybullet/wbic/pybullet_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,65 @@ class Go2JointIdx(object):
class JointGains(object):
# kp = 5. * np.ones(27)
# kd = 0. * np.ones(27)
kp = np.array([
10, 10, 10, 10, 10, 10, 10, 5, 5, 5, 5, 5, 5, 5, 10, 10, 10, 10, 10,
10, 10, 5, 5, 5, 5, 5, 5
])
kd = np.array([
0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.001, 0.001, 0.001, 0.001,
0.001, 0.001, 0.01, 0.01, 0.001, 0.01, 0.01, 0.01, 0.01, 0.01, 0.001,
0.001, 0.001, 0.001, 0.001, 0.001
])
kp = np.array(
[
10,
10,
10,
10,
10,
10,
10,
5,
5,
5,
5,
5,
5,
5,
10,
10,
10,
10,
10,
10,
10,
5,
5,
5,
5,
5,
5,
]
)
kd = np.array(
[
0.01,
0.01,
0.01,
0.01,
0.01,
0.01,
0.01,
0.001,
0.001,
0.001,
0.001,
0.001,
0.001,
0.01,
0.01,
0.001,
0.01,
0.01,
0.01,
0.01,
0.01,
0.001,
0.001,
0.001,
0.001,
0.001,
0.001,
]
)
16 changes: 8 additions & 8 deletions config/optimo/ihwbc_gains.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ wbc:
exp_weight_at_contact : [0., 0., 0.]
exp_kp : [200., 200., 200.]
exp_kd : [10., 10., 10.]

f3_pos_task:
########################################################################
## sim params
Expand Down Expand Up @@ -182,19 +182,19 @@ wbc:
## sim params
########################################################################
sim_weight : [0., 0., 0., 1e-8, 1e-8, 5e-10] ## trq, force order

f1_rf_task:
########################################################################
## sim params
########################################################################
sim_weight : [0., 0., 0., 1e-8, 1e-8, 5e-10] ## trq, force order
sim_weight : [0., 0., 0., 1e-8, 1e-8, 5e-10] ## trq, force order

f2_rf_task:
########################################################################
## sim params
########################################################################
sim_weight : [0., 0., 0., 1e-8, 1e-8, 5e-10] ## trq, force order
sim_weight : [0., 0., 0., 1e-8, 1e-8, 5e-10] ## trq, force order

f3_rf_task:
########################################################################
## sim params
Expand Down Expand Up @@ -241,7 +241,7 @@ wbc:
state_machine:
initialize:
init_duration: 2.
wait_time: 0.
wait_time: 0.
target_joint_pos: [0.0, 3.665191429188092, 0.0, -2.0943951023931953, 0.0, -1.0471975511965976, 0.0]
b_stay_here: false
task_transit_time: 0.3
Expand All @@ -250,7 +250,7 @@ state_machine:
duration: 0.01
wait_time: 0.
b_stay_here: false

ee_traj:
duration: 1.
wait_time: 0.
Expand Down
14 changes: 8 additions & 6 deletions config/optimo/pybullet_simulation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

def deg2rad(deg):
return deg * 3.14159265359 / 180

Expand All @@ -10,9 +9,12 @@ class Config(object):
INITIAL_BASE_JOINT_QUAT = [0, 0, 0, 1]
INITIAL_JOINT_POSITION = [
deg2rad(0),
deg2rad(180), 0.0,
deg2rad(-90), 0.0,
deg2rad(-90), 0.0
deg2rad(180),
0.0,
deg2rad(-90),
0.0,
deg2rad(-90),
0.0,
]

PRINT_ROBOT_INFO = True
Expand Down Expand Up @@ -71,5 +73,5 @@ class PlatoJointIdx(object):
class ActuatorGains(object):
# KP = [200., 200., 200., 200., 200., 200., 200.]
# KD = [5., 5., 5., 5., 5., 5., 5.]
KP = [0., 0., 0., 0., 0., 0., 0.]
KD = [0., 0., 0., 0., 0., 0., 0.]
KP = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
KD = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
2 changes: 1 addition & 1 deletion config/optimo/sim/mujoco/ihwbc/pnc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ wbc:
state_machine:
initialize:
duration: 2.
wait_time: 0.
wait_time: 0.
target_joint_pos: [0.0, 3.665191429188092, 0.0, -2.0943951023931953, 0.0, -1.0471975511965976, 0.0]
b_stay_here: false

Expand Down
2 changes: 1 addition & 1 deletion config/optimo/sim/pybullet/ihwbc/pnc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ wbc:
state_machine:
initialize:
duration: 2.
wait_time: 0.
wait_time: 0.
target_joint_pos: [0.0, 3.665191429188092, 0.0, -2.0943951023931953, 0.0, -1.0471975511965976, 0.0]
b_stay_here: false

Expand Down
13 changes: 8 additions & 5 deletions config/optimo/sim/pybullet/ihwbc/pybullet_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ class Config(object):
INITIAL_BASE_JOINT_QUAT = [0, 0, 0, 1]
INITIAL_JOINT_POSITION = [
deg2rad(0),
deg2rad(180), 0.0,
deg2rad(-90), 0.0,
deg2rad(-90), 0.0
deg2rad(180),
0.0,
deg2rad(-90),
0.0,
deg2rad(-90),
0.0,
]

PRINT_ROBOT_INFO = True
Expand Down Expand Up @@ -70,5 +73,5 @@ class PlatoJointIdx(object):
class ActuatorGains(object):
# KP = [200., 200., 200., 200., 200., 200., 200.]
# KD = [5., 5., 5., 5., 5., 5., 5.]
KP = [0., 0., 0., 0., 0., 0., 0.]
KD = [0., 0., 0., 0., 0., 0., 0.]
KP = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
KD = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
2 changes: 1 addition & 1 deletion controller/control_architecture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ControlArchitecture {
public:
ControlArchitecture(PinocchioRobotSystem *robot)
: robot_(robot), b_loco_state_first_visit_(true),
b_manip_state_first_visit_(true){};
b_manip_state_first_visit_(true) {};
virtual ~ControlArchitecture() = default;

virtual void GetCommand(void *command) = 0;
Expand Down
4 changes: 2 additions & 2 deletions controller/draco_controller/draco_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DracoSensorData {
b_rf_contact_(false), lf_contact_normal_(0.), rf_contact_normal_(0.),
base_joint_pos_(Eigen::Vector3d::Zero()), base_joint_quat_(0, 0, 0, 1),
base_joint_lin_vel_(Eigen::Vector3d::Zero()),
base_joint_ang_vel_(Eigen::Vector3d::Zero()){};
base_joint_ang_vel_(Eigen::Vector3d::Zero()) {};
virtual ~DracoSensorData() = default;

Eigen::Vector4d imu_frame_quat_; // x, y, z, w order
Expand All @@ -47,7 +47,7 @@ class DracoCommand {
DracoCommand()
: joint_pos_cmd_(Eigen::VectorXd::Zero(draco::n_adof)),
joint_vel_cmd_(Eigen::VectorXd::Zero(draco::n_adof)),
joint_trq_cmd_(Eigen::VectorXd::Zero(draco::n_adof)){};
joint_trq_cmd_(Eigen::VectorXd::Zero(draco::n_adof)) {};
virtual ~DracoCommand() = default;

Eigen::VectorXd joint_pos_cmd_;
Expand Down
4 changes: 2 additions & 2 deletions controller/go2_controller/go2_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Go2SensorData {
RR_normal_force_(0.), base_joint_pos_(Eigen::Vector3d::Zero()),
base_joint_quat_(0, 0, 0, 1),
base_joint_lin_vel_(Eigen::Vector3d::Zero()),
base_joint_ang_vel_(Eigen::Vector3d::Zero()){};
base_joint_ang_vel_(Eigen::Vector3d::Zero()) {};
virtual ~Go2SensorData() = default;

Eigen::Vector4d imu_frame_quat_; // x, y, z, w order
Expand Down Expand Up @@ -52,7 +52,7 @@ class Go2Command {
Go2Command()
: joint_pos_cmd_(Eigen::VectorXd::Zero(go2::n_adof)),
joint_vel_cmd_(Eigen::VectorXd::Zero(go2::n_adof)),
joint_trq_cmd_(Eigen::VectorXd::Zero(go2::n_adof)){};
joint_trq_cmd_(Eigen::VectorXd::Zero(go2::n_adof)) {};
virtual ~Go2Command() = default;

Eigen::VectorXd joint_pos_cmd_;
Expand Down
2 changes: 1 addition & 1 deletion controller/interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class InterruptHandler;

class Interface {
public:
Interface() : count_(0), running_time_(0.){};
Interface() : count_(0), running_time_(0.) {};

virtual ~Interface() = default;

Expand Down
2 changes: 1 addition & 1 deletion controller/optimo_controller/optimo_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

// TODO:
#if B_USE_ZMQ
//#include "controller/optimo_controller/optimo_data_manager.hpp"
// #include "controller/optimo_controller/optimo_data_manager.hpp"
#endif

OptimoController::OptimoController(OptimoTCIContainer *tci_container,
Expand Down
2 changes: 1 addition & 1 deletion controller/optimo_controller/optimo_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

// TODO:
#if B_USE_ZMQ
//#include "controller/optimo_controller/optimo_data_manager.hpp"
// #include "controller/optimo_controller/optimo_data_manager.hpp"
#endif

OptimoInterface::OptimoInterface() : Interface() {
Expand Down
4 changes: 2 additions & 2 deletions controller/optimo_controller/optimo_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class OptimoSensorData {
joint_trq_(Eigen::VectorXd::Zero(optimo::n_adof)),
joint_sea_trq_(Eigen::VectorXd::Zero(optimo::n_adof)),
base_pos_(Eigen::Vector3d::Zero()),
base_quat_(Eigen::Vector4d(0., 0., 0., 1.)){};
base_quat_(Eigen::Vector4d(0., 0., 0., 1.)) {};

virtual ~OptimoSensorData() = default;

Expand All @@ -36,7 +36,7 @@ class OptimoCommand {
OptimoCommand()
: joint_pos_cmd_(Eigen::VectorXd::Zero(optimo::n_adof)),
joint_vel_cmd_(Eigen::VectorXd::Zero(optimo::n_adof)),
joint_trq_cmd_(Eigen::VectorXd::Zero(optimo::n_adof)){};
joint_trq_cmd_(Eigen::VectorXd::Zero(optimo::n_adof)) {};
virtual ~OptimoCommand() = default;

Eigen::VectorXd joint_pos_cmd_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ class Initialize : public StateMachine {
double task_transit_time_;

MinJerkCurveVec *min_jerk_curves_;
};
};
Loading

0 comments on commit 00aaca6

Please sign in to comment.