7 msgs::ErrorStatus status;
10 msgs::GenerateFeetPoseService feet_pose_service;
11 feet_pose_service.request.request.header = header;
12 feet_pose_service.request.request.flags = msgs::FeetPoseRequest::FLAG_CURRENT | msgs::FeetPoseRequest::FLAG_3D;
14 if (!generate_feet_pose_client.
call(feet_pose_service.request, feet_pose_service.response))
15 return ErrorStatusError(msgs::ErrorStatus::ERR_UNKNOWN,
"determineStartFeetPose",
"Can't call 'FeetPoseGenerator'!",
true, 1.0);
18 if (hasError(feet_pose_service.response.status))
21 status += ErrorStatusWarning(msgs::ErrorStatus::WARN_UNKNOWN,
"determineStartFeetPose",
"Can't obtain start feet pose; defaulting to origin.",
true, 1.0);
23 feet_pose_service.request.request.pose = geometry_msgs::Pose();
25 feet_pose_service.request.request.flags = msgs::FeetPoseRequest::FLAG_3D;
27 if (!generate_feet_pose_client.
call(feet_pose_service.request, feet_pose_service.response))
28 return ErrorStatusError(msgs::ErrorStatus::ERR_UNKNOWN,
"determineStartFeetPose",
"Can't call 'FeetPoseGenerator'!",
true, 1.0);
30 if (hasError(feet_pose_service.response.status))
32 status += feet_pose_service.response.status;
36 else if (hasWarning(feet_pose_service.response.status))
37 status += feet_pose_service.response.status;
39 start_feet = feet_pose_service.response.feet;
45 msgs::GenerateFeetPoseService feet_pose_service;
46 feet_pose_service.request.request.header = goal_pose.header;
47 feet_pose_service.request.request.pose = goal_pose.pose;
48 feet_pose_service.request.request.flags = msgs::FeetPoseRequest::FLAG_3D;
50 if (!generate_feet_pose_client.
call(feet_pose_service.request, feet_pose_service.response))
51 return ErrorStatusError(msgs::ErrorStatus::ERR_UNKNOWN,
"determineStartFeetPose",
"Can't call 'FeetPoseGenerator'!");
53 goal_feet = feet_pose_service.response.feet;
55 return feet_pose_service.response.status;
60 msgs::TransformFootPoseService transform_service;
61 transform_service.request.foot = foot;
62 transform_service.request.target_frame.data = target_frame;
64 if (!transform_foot_pose_client.
call(transform_service.request, transform_service.response))
65 return ErrorStatusError(msgs::ErrorStatus::ERR_UNKNOWN,
"transformToPlannerFrame",
"Can't call 'FootPoseTransformer' for foot pose transform!");
67 foot = transform_service.response.foot;
69 return transform_service.response.status;
74 msgs::TransformFeetPosesService transform_service;
75 transform_service.request.feet = feet;
76 transform_service.request.target_frame.data = target_frame;
78 if (!transform_feet_poses_client.
call(transform_service.request, transform_service.response))
79 return ErrorStatusError(msgs::ErrorStatus::ERR_UNKNOWN,
"transformToPlannerFrame",
"Can't call 'FootPoseTransformer' for feet poses transform!");
81 feet = transform_service.response.feet;
83 return transform_service.response.status;
88 msgs::TransformStepPlanService transform_service;
89 transform_service.request.step_plan = step_plan;
90 transform_service.request.target_frame.data = target_frame;
92 if (!transform_step_plan_client.
call(transform_service.request, transform_service.response))
93 return ErrorStatusError(msgs::ErrorStatus::ERR_UNKNOWN,
"transformToPlannerFrame",
"Can't call 'FootPoseTransformer' for step plan transform!");
95 step_plan = transform_service.response.step_plan;
97 return transform_service.response.status;
120 ROS_ERROR(
"Couldn't retrieve parameter '%s' as RPY orienation", (nh.
getNamespace()+
"/"+name).c_str());
132 return getXYZ(nh,
"foot/size", foot_size);
137 return getXYZ(nh,
"upper_body/size", upper_body_size);
142 return getXYZ(nh,
"upper_body/origin_shift", upper_body_origin_shift);
147 bool getGridMapCoords(
const nav_msgs::OccupancyGrid& map,
double x,
double y,
int& map_x,
int& map_y)
149 map_x = round((x-map.info.origin.position.x)/map.info.resolution);
150 map_y = round((y-map.info.origin.position.y)/map.info.resolution);
152 if (map_x < 0 || (
int) map.info.width <= map_x ||
153 map_y < 0 || (
int) map.info.height <= map_y)
159 bool getGridMapIndex(
const nav_msgs::OccupancyGrid& map,
double x,
double y,
int& idx)
166 idx = map_x + map_y * map.info.width;
bool call(MReq &req, MRes &res)
const std::string & getNamespace() const
static geometry_msgs::Quaternion createQuaternionMsgFromYaw(double yaw)
bool getParam(const std::string &key, std::string &s) const
bool hasParam(const std::string &key) const