Skip to content

Commit 0dd67bf

Browse files
committed
Merge with master branch
2 parents 7dcbb59 + 88da55d commit 0dd67bf

37 files changed

+597
-260
lines changed

.cirrus.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,24 @@ build_task:
1616
--local_ram_resources=24000
1717
--local_cpu_resources=8
1818
//...
19+
build_focal_task:
20+
timeout_in: 120m
21+
container:
22+
dockerfile: install/focal/Dockerfile
23+
cpu: 8
24+
memory: 24
25+
test_script:
26+
- bazel build
27+
--define=WITH_SNOPT=OFF
28+
--local_ram_resources=24000
29+
--local_cpu_resources=8
30+
--jobs=8
31+
//...
32+
- bazel test
33+
--define=WITH_SNOPT=OFF
34+
--local_ram_resources=24000
35+
--local_cpu_resources=8
36+
//...
1937
build_with_ros_task:
2038
timeout_in: 120m
2139
container:

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
Warning! This is very much "development-level" code and is provided as-is. APIs are likely to be unstable and, while we hope for the documentation to be thorough and accurate, we make no guarantees.
33

44
## Current Continuous Integration Status
5-
* `master` branch build and unit tests: [![Build Status](https://api.cirrus-ci.com/github/DAIRLab/dairlib.svg?task=build&script=test)](https://cirrus-ci.com/github/DAIRLab/dairlib)
5+
* `master` branch build and unit tests (Ubuntu 18.04): [![Build Status](https://api.cirrus-ci.com/github/DAIRLab/dairlib.svg?task=build&script=test)](https://cirrus-ci.com/github/DAIRLab/dairlib)
6+
* `master` branch build and unit tests (Ubuntu 20.04): [![Build Status](https://api.cirrus-ci.com/github/DAIRLab/dairlib.svg?task=build_focal&script=test)](https://cirrus-ci.com/github/DAIRLab/dairlib)
7+
* `master` branch build and unit tests (Ubuntu 18.04 with ROS): [![Build Status](https://api.cirrus-ci.com/github/DAIRLab/dairlib.svg?task=build_with_ros&script=test)](https://cirrus-ci.com/github/DAIRLab/dairlib)
68
* Experimental build against Drake's `master` branch: [![Build Status](https://api.cirrus-ci.com/github/DAIRLab/dairlib.svg?task=drake_master_build&script=test)](https://cirrus-ci.com/github/DAIRLab/dairlib)
79
## Complete Build Instructions
810

WORKSPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ workspace(name = "dairlib")
1111
# export DAIRLIB_LOCAL_DRAKE_PATH=/home/user/workspace/drake
1212

1313
# Choose a revision of Drake to use.
14-
DRAKE_COMMIT = "1cab4e23d5d41690a3c43a0af80cb62f7eaacf3f"
14+
DRAKE_COMMIT = "2f16f87df02d7c6ef436fb87437e59a3df840bb5"
1515

16-
DRAKE_CHECKSUM = "da63499c336e690afa41db030c7586e8c2c2ae53ca0a81acf8f94d162a6a2b0e"
16+
DRAKE_CHECKSUM = "fb65e3f2949a7d50075afa658ec0043b6c8a32f8f692628032c53a18176eff76"
1717
# Before changing the COMMIT, temporarily uncomment the next line so that Bazel
1818
# displays the suggested new value for the CHECKSUM.
1919
# DRAKE_CHECKSUM = "0" * 64

examples/Cassie/BUILD.bazel

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ cc_library(
2727
srcs = ["cassie_utils.cc"],
2828
hdrs = ["cassie_utils.h"],
2929
deps = [
30+
":cassie_encoder",
3031
":cassie_urdf",
3132
":sim_cassie_sensor_aggregator",
3233
"//common",
3334
"//multibody:utils",
3435
"//multibody/kinematic",
3536
"//systems:robot_lcm_systems",
36-
":cassie_encoder",
3737
"@drake//:drake_shared_library",
3838
],
3939
)
@@ -226,6 +226,7 @@ cc_binary(
226226
name = "multibody_sim",
227227
srcs = ["multibody_sim.cc"],
228228
deps = [
229+
":cassie_encoder",
229230
":cassie_fixed_point_solver",
230231
":cassie_urdf",
231232
":cassie_utils",
@@ -234,7 +235,6 @@ cc_binary(
234235
"//systems:robot_lcm_systems",
235236
"//systems/framework:vector",
236237
"//systems/primitives",
237-
":cassie_encoder",
238238
"@drake//:drake_shared_library",
239239
"@gflags",
240240
],
@@ -256,6 +256,23 @@ cc_binary(
256256
],
257257
)
258258

259+
cc_binary(
260+
name = "multibody_sim_w_ground_incline",
261+
srcs = ["multibody_sim_w_ground_incline.cc"],
262+
deps = [
263+
":cassie_encoder",
264+
":cassie_fixed_point_solver",
265+
":cassie_urdf",
266+
":cassie_utils",
267+
"//solvers:optimization_utils",
268+
"//systems:robot_lcm_systems",
269+
"//systems/framework:vector",
270+
"//systems/primitives",
271+
"@drake//:drake_shared_library",
272+
"@gflags",
273+
],
274+
)
275+
259276
cc_binary(
260277
name = "parse_log_test",
261278
srcs = ["test/parse_log_test.cc"],

examples/Cassie/cassie_fixed_point_solver.cc

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,11 @@ void CassieFixedPointSolver(
3131
VectorXd* lambda_result, std::string visualize_model_urdf,
3232
double ground_incline, VectorXd* all_sol) {
3333
// Get the rotational matrix
34-
Eigen::AngleAxisd rollAngle(ground_incline, Eigen::Vector3d::UnitZ());
35-
Eigen::AngleAxisd yawAngle(0, Eigen::Vector3d::UnitY());
36-
Eigen::AngleAxisd pitchAngle(0, Eigen::Vector3d::UnitX());
37-
Eigen::Quaternion<double> quat = rollAngle * yawAngle * pitchAngle;
38-
Eigen::Matrix3d rotationMatrix = quat.matrix();
39-
// Get normal direction
40-
Eigen::Vector3d ground_normal(sin(ground_incline), 0, cos(ground_incline));
34+
Eigen::AngleAxisd roll_angle(ground_incline, Eigen::Vector3d::UnitZ());
35+
Eigen::AngleAxisd yaw_angle(0, Eigen::Vector3d::UnitY());
36+
Eigen::AngleAxisd pitch_angle(0, Eigen::Vector3d::UnitX());
37+
Eigen::Quaternion<double> quat = roll_angle * yaw_angle * pitch_angle;
38+
Eigen::Matrix3d rotation_mat = quat.matrix();
4139

4240
multibody::KinematicEvaluatorSet<double> evaluators(plant);
4341

@@ -48,28 +46,30 @@ void CassieFixedPointSolver(
4846
evaluators.add_evaluator(&right_loop);
4947

5048
// Add contact points
49+
std::vector<int> yz_active_idx = {1, 2};
50+
std::vector<int> z_active_idx = {2};
5151
auto left_toe = LeftToeFront(plant);
52-
auto left_toe_evaluator = multibody::WorldPointEvaluator(plant,
53-
left_toe.first, left_toe.second, rotationMatrix,
54-
Eigen::Vector3d(0, toe_spread, 0), {1, 2});
52+
auto left_toe_evaluator = multibody::WorldPointEvaluator(
53+
plant, left_toe.first, left_toe.second, rotation_mat,
54+
Eigen::Vector3d(0, toe_spread, 0), yz_active_idx);
5555
evaluators.add_evaluator(&left_toe_evaluator);
5656

5757
auto left_heel = LeftToeRear(plant);
58-
auto left_heel_evaluator = multibody::WorldPointEvaluator(plant,
59-
left_heel.first, left_heel.second, ground_normal,
60-
Eigen::Vector3d::Zero(), false);
58+
auto left_heel_evaluator = multibody::WorldPointEvaluator(
59+
plant, left_heel.first, left_heel.second, rotation_mat,
60+
Eigen::Vector3d::Zero(), z_active_idx);
6161
evaluators.add_evaluator(&left_heel_evaluator);
6262

6363
auto right_toe = RightToeFront(plant);
64-
auto right_toe_evaluator = multibody::WorldPointEvaluator(plant,
65-
right_toe.first, right_toe.second, rotationMatrix,
66-
Eigen::Vector3d(0, -toe_spread, 0), {1, 2});
64+
auto right_toe_evaluator = multibody::WorldPointEvaluator(
65+
plant, right_toe.first, right_toe.second, rotation_mat,
66+
Eigen::Vector3d(0, -toe_spread, 0), yz_active_idx);
6767
evaluators.add_evaluator(&right_toe_evaluator);
6868

6969
auto right_heel = RightToeRear(plant);
70-
auto right_heel_evaluator = multibody::WorldPointEvaluator(plant,
71-
right_heel.first, right_heel.second, ground_normal,
72-
Eigen::Vector3d::Zero(), false);
70+
auto right_heel_evaluator = multibody::WorldPointEvaluator(
71+
plant, right_heel.first, right_heel.second, rotation_mat,
72+
Eigen::Vector3d::Zero(), z_active_idx);
7373
evaluators.add_evaluator(&right_heel_evaluator);
7474

7575
auto program = multibody::MultibodyProgram(plant);

examples/Cassie/cassie_state_estimator.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include <fstream>
77
#include <utility>
88

9-
#include "drake/math/orthonormal_basis.h"
109
#include "drake/solvers/equality_constrained_qp_solver.h"
1110
#include "drake/solvers/mathematical_program.h"
1211
#include "drake/solvers/solve.h"

examples/Cassie/director_scripts/pd_panel.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,7 @@
3838
"toe_left",
3939
"toe_right"]
4040

41-
# joint_default = [0,0,0,0,0,0,0,0,0,0]
42-
# kp_default = [20,20,20,20,20,20,20,20,2,2]
43-
# kd_default = [5,5,5,5,5,5,5,5,1,1]
44-
45-
# joint_default = [0,0,0,0,0,0,0,0,0,0]
46-
# kp_default = [0,0,0,0,0,0,0,0,0,0]
47-
# kd_default = [0,0,0,0,0,0,0,0,0,0]
48-
49-
# Set of gains with which Cassie can stand:
50-
# joint_default = [0.2,-.2,0,0,0.35,0.35,-0.9,-0.9,-1.8,-1.8]
51-
# kp_default = [i for i in [20,20,10,10,20,20,100,100,10,10]]
52-
# kd_default = [i for i in [1,1,1,1,1,1,2,2,1,1]]
53-
54-
# Set of gains with which COM is within support polygon when we lower the hoist
41+
# Set of gains with which COM is within support polygon when we lower the hoist
5542
joint_default = [-0.01,.01,0,0,0.55,0.55,-1.5,-1.5,-1.8,-1.8]
5643
kp_default = [i for i in [80,80,50,50,50,50,50,50,10,10]]
5744
kd_default = [i for i in [1,1,1,1,1,1,2,2,1,1]]
@@ -207,8 +194,6 @@ def publish_clicked(self):
207194
for i in range(100):
208195
# ramp up the gains for 5 seconds
209196
msg.timestamp = int(time.time() * 1e6)
210-
# msg.kp = list(self.kp_ + i / 99.0 * np.array(self.values[len(joint_names):2*len(joint_names)] - self.kp_))
211-
# msg.kd = list(self.kd_ + i / 99.0 * np.array(self.values[2*len(joint_names):3*len(joint_names)] - self.kd_))
212197
msg.kp = [b + i / 99.0 * (a - b) for a, b in zip(self.values[len(joint_names):2*len(joint_names)], self.kp_)]
213198
msg.kd = [b + i / 99.0 * (a - b) for a, b in zip(self.values[2*len(joint_names):3*len(joint_names)], self.kd_)]
214199

examples/Cassie/dispatcher_robot_out.cc

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ DEFINE_bool(broadcast_robot_state, false, "broadcast to planner thread");
4545
DEFINE_string(address, "127.0.0.1", "IPv4 address to receive on.");
4646
DEFINE_int64(port, 25001, "Port to receive on.");
4747
DEFINE_double(pub_rate, 0.1, "Network LCM pubishing period (s).");
48+
DEFINE_double(fast_network_pub_rate, 0.01, "Network LCM pubishing period (s).");
4849
DEFINE_bool(simulation, false,
4950
"Simulated or real robot (default=false, real robot)");
5051
DEFINE_bool(test_with_ground_truth_state, false,
@@ -214,7 +215,6 @@ int do_main(int argc, char* argv[]) {
214215
// connect cassie_out publisher
215216
builder.Connect(*output_sender, *output_pub);
216217

217-
218218
// Connect appropriate input receiver for simulation
219219
systems::CassieOutputReceiver* input_receiver = nullptr;
220220
if (FLAGS_simulation) {
@@ -243,19 +243,20 @@ int do_main(int argc, char* argv[]) {
243243
auto robot_output_sender =
244244
builder.AddSystem<systems::RobotOutputSender>(plant, true, true);
245245

246-
if(FLAGS_floating_base){
247-
// Create and connect contact estimation publisher.
248-
auto contact_pub =
249-
builder.AddSystem(LcmPublisherSystem::Make<dairlib::lcmt_contact>(
250-
"CASSIE_CONTACT_DISPATCHER", &lcm_local, {TriggerType::kForced}));
251-
builder.Connect(state_estimator->get_contact_output_port(),
252-
contact_pub->get_input_port());
253-
//TODO(yangwill): Consider filtering contact estimation
254-
auto gm_contact_pub =
255-
builder.AddSystem(LcmPublisherSystem::Make<drake::lcmt_contact_results_for_viz>(
256-
"CASSIE_GM_CONTACT_DISPATCHER", &lcm_local, {TriggerType::kForced}));
257-
builder.Connect(state_estimator->get_gm_contact_output_port(),
258-
gm_contact_pub->get_input_port());
246+
if (FLAGS_floating_base) {
247+
// Create and connect contact estimation publisher.
248+
auto contact_pub =
249+
builder.AddSystem(LcmPublisherSystem::Make<dairlib::lcmt_contact>(
250+
"CASSIE_CONTACT_DISPATCHER", &lcm_local, {TriggerType::kForced}));
251+
builder.Connect(state_estimator->get_contact_output_port(),
252+
contact_pub->get_input_port());
253+
// TODO(yangwill): Consider filtering contact estimation
254+
auto gm_contact_pub = builder.AddSystem(
255+
LcmPublisherSystem::Make<drake::lcmt_contact_results_for_viz>(
256+
"CASSIE_GM_CONTACT_DISPATCHER", &lcm_local,
257+
{TriggerType::kForced}));
258+
builder.Connect(state_estimator->get_gm_contact_output_port(),
259+
gm_contact_pub->get_input_port());
259260
}
260261

261262
// Pass through to drop all but positions and velocities
@@ -306,7 +307,7 @@ int do_main(int argc, char* argv[]) {
306307
auto net_state_pub =
307308
builder.AddSystem(LcmPublisherSystem::Make<dairlib::lcmt_robot_output>(
308309
"NETWORK_CASSIE_STATE_DISPATCHER", &lcm_network,
309-
{TriggerType::kPeriodic}, 0.01));
310+
{TriggerType::kPeriodic}, FLAGS_fast_network_pub_rate));
310311
builder.Connect(*robot_output_sender, *net_state_pub);
311312

312313
// Option 3 -- find a way to only publish to network after receiving message

0 commit comments

Comments
 (0)