update
This commit is contained in:
@@ -53,7 +53,9 @@ StatusResponse RobotModel::Load(const ConfigNode& root) {
|
||||
// thay vi `wheel_separation` nghia la moi phep quay sai ti le, va khong
|
||||
// co gi bao.
|
||||
const std::vector<std::string> unknown = g.UnknownKeys(
|
||||
{"wheel_radius", "wheel_separation", "robot_radius", "body_half_width"});
|
||||
{"wheel_radius", "wheel_separation", "robot_radius",
|
||||
"body_half_width", "body_length", "body_width", "body_height",
|
||||
"body_offset_x", "ground_clearance"});
|
||||
if (!unknown.empty()) {
|
||||
std::string m = "robot.yaml geometry: khoa la:";
|
||||
for (const auto& k : unknown) m += " " + k;
|
||||
@@ -65,6 +67,15 @@ StatusResponse RobotModel::Load(const ConfigNode& root) {
|
||||
geometry_.robot_radius = g.get<double>("robot_radius", geometry_.robot_radius);
|
||||
geometry_.body_half_width =
|
||||
g.get<double>("body_half_width", geometry_.body_half_width);
|
||||
// Kich thuoc khoi hop -- chi de VE, xem ghi chu o RobotGeometry.
|
||||
geometry_.body_length =
|
||||
g.get<double>("body_length", geometry_.body_length);
|
||||
geometry_.body_width = g.get<double>("body_width", geometry_.body_width);
|
||||
geometry_.body_height = g.get<double>("body_height", geometry_.body_height);
|
||||
geometry_.body_offset_x =
|
||||
g.get<double>("body_offset_x", geometry_.body_offset_x);
|
||||
geometry_.ground_clearance =
|
||||
g.get<double>("ground_clearance", geometry_.ground_clearance);
|
||||
}
|
||||
if (!(geometry_.wheel_radius > 0.0) || !(geometry_.wheel_separation > 0.0)) {
|
||||
return StatusResponse::Error(StatusCode::kInvalidArgument,
|
||||
|
||||
Reference in New Issue
Block a user