update
This commit is contained in:
@@ -31,6 +31,20 @@ struct RobotGeometry {
|
||||
double wheel_separation = 0.36;
|
||||
double robot_radius = 0.24;
|
||||
double body_half_width = 0.17;
|
||||
|
||||
// Than robot la mot KHOI HOP, khong phai hinh tru.
|
||||
//
|
||||
// Lay tu `robot.urdf.xacro` cua ban ROS: body 0.40 x 0.34 x 0.85 m, lech
|
||||
// -0.06 m theo x, va day hop cach san `ground_clearance`.
|
||||
//
|
||||
// ⚠️ Cac so nay chi de VE. `robot_radius` van la thu dung cho va cham va
|
||||
// cho bumper -- mot hinh tron bao ngoai khoi hop. Doi hai thu do lam mot se
|
||||
// lam phep va cham phu thuoc goc quay, va do la mot lop bug moi.
|
||||
double body_length = 0.40;
|
||||
double body_width = 0.34;
|
||||
double body_height = 0.85;
|
||||
double body_offset_x = -0.06;
|
||||
double ground_clearance = 0.04;
|
||||
};
|
||||
|
||||
struct BaseLimits {
|
||||
|
||||
@@ -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