_coordinate_frame_type
时间: 2023-06-16 15:05:25 浏览: 58
_coordinate_frame_type 是一个机器人领域的参数,用于确定参考坐标系的类型。在机器人控制中,坐标系是非常重要的,因为它描述了机器人的位置和运动。_coordinate_frame_type 可能包括以下类型:
1. Cartesian 坐标系:用于描述机器人的位置和方向。
2. Joint 坐标系:用于描述机器人的关节角度。
3. Polar 坐标系:用于描述机器人的极坐标位置。
4. 三维坐标系:用于描述机器人在三维空间中的位置和方向。
5. 六维坐标系:用于描述机器人在三维空间中的位置和方向,并且包括机器人的速度和角速度。
在不同的机器人应用中,可能需要使用不同的坐标系类型。_coordinate_frame_type 参数用于指定所使用的坐标系类型,以确保机器人能够正确地解释和执行命令。
相关问题
root@in_dev_docker:/apollo# bash scripts/msf_create_lossless_map.sh /apollo/hdmap/pcd_apollo/ 50 /apollo/hdmap/ /apollo/bazel-bin WARNING: Logging before InitGoogleLogging() is written to STDERR E0715 22:08:35.399576 6436 lossless_map_creator.cc:162] num_trials = 1 Pcd folders are as follows: /apollo/hdmap/pcd_apollo/ Resolution: 0.125 Dataset: /apollo/hdmap/pcd_apollo Dataset: /apollo/hdmap/pcd_apollo/ Loaded the map configuration from: /apollo/hdmap//lossless_map/config.xml. Saved the map configuration to: /apollo/hdmap//lossless_map/config.xml. Saved the map configuration to: /apollo/hdmap//lossless_map/config.xml. E0715 22:08:35.767315 6436 lossless_map_creator.cc:264] ieout_poses = 1706 Failed to find match for field 'intensity'. Failed to find match for field 'timestamp'. E0715 22:08:35.769896 6436 velodyne_utility.cc:46] Un-organized-point-cloud E0715 22:08:35.781770 6436 lossless_map_creator.cc:275] Loaded 245443D Points at Trial: 0 Frame: 0. F0715 22:08:35.781791 6436 base_map_node_index.cc:101] Check failed: false *** Check failure stack trace: *** scripts/msf_create_lossless_map.sh: line 11: 6436 Aborted (core dumped) $APOLLO_BIN_PREFIX/modules/localization/msf/local_tool/map_creation/lossless_map_creator --use_plane_inliers_only true --pcd_folders $1 --pose_files $2 --map_folder $IN_FOLDER --zone_id $ZONE_ID --coordinate_type UTM --map_resolution_type single root@in_dev_docker:/apollo# bash scripts/msf_create_lossless_map.sh /apollo/hdmap/pcd_apollo/ 50 /apollo/hdmap/
根据提供的信息,执行脚本 `scripts/msf_create_lossless_map.sh` 时出现了错误。具体的错误信息如:
```
E0715 22:08:35.399576 6436 lossless_map_creator.cc:162] num_trials = 1
Pcd folders are as follows:
/apollo/hdmap/pcd_apollo/
Resolution: 0.125
Dataset: /apollo/hdmap/pcd_apollo
Dataset: /apollo/hdmap/pcd_apollo/
Loaded the map configuration from: /apollo/hdmap//lossless_map/config.xml.
Saved the map configuration to: /apollo/hdmap//lossless_map/config.xml.
Saved the map configuration to: /apollo/hdmap//lossless_map/config.xml.
E0715 22:08:35.767315 6436 lossless_map_creator.cc:264] ieout_poses = 1706
Failed to find match for field 'intensity'.
Failed to find match for field 'timestamp'.
E0715 22:08:35.769896 6436 velodyne_utility.cc:46] Un-organized-point-cloud
E0715 22:08:35.781770 6436 lossless_map_creator.cc:275] Loaded 245443D Points at Trial: 0 Frame: 0.
F0715 22:08:35.781791 6436 base_map_node_index.cc:101] Check failed: false
*** Check failure stack trace: ***
scripts/msf_create_lossless_map.sh: line 11: 6436 Aborted (core dumped) $APOLLO_BIN_PREFIX/modules/localization/msf/local_tool/map_creation/lossless_map_creator --use_plane_inliers_only true --pcd_folders $1 --pose_files $2 --map_folder $IN_FOLDER --zone_id $ZONE_ID --coordinate_type UTM --map_resolution_type single
```
这段错误信息表明在执行脚本时发生了一个检查失败的情况。错误的具体位置在 `base_map_node_index.cc:101`。可能的原因包括:
1. 数据不匹配:脚本中使用的数据可能存在不匹配的情况,例如字段名或者数据格式不正确。
2. 数据文件缺失:脚本所需的某些数据文件可能不存在或者路径不正确。
3. 依赖问题:脚本所依赖的某些组件或库可能缺失或者版本不兼容。
请检查脚本 `scripts/msf_create_lossless_map.sh` 中的相关代码,确保数据文件和依赖项的正确性。如果问题仍然存在,您可以提供更多的上下文信息,以便我们能够更好地帮助您解决问题。
mediapipe 0.8.9 用holistic_tracking_cpu.pbtxt输出右肩坐标 c++
在 C++ 中使用 Holistic 模型输出右肩坐标的示例代码如下:
```c++
#include <iostream>
#include <vector>
#include "mediapipe/framework/formats/image_frame.h"
#include "mediapipe/framework/formats/landmark.pb.h"
#include "mediapipe/framework/formats/landmark_list.pb.h"
#include "mediapipe/framework/port/opencv_highgui_inc.h"
#include "mediapipe/framework/port/opencv_imgproc_inc.h"
#include "mediapipe/framework/port/status.h"
#include "mediapipe/framework/port/statusor.h"
#include "mediapipe/framework/tool/options_util.h"
#include "mediapipe/framework/tool/status_util.h"
#include "mediapipe/framework/calculator_framework.h"
#include "mediapipe/framework/calculator_graph.h"
#include "mediapipe/framework/formats/matrix.h"
#include "mediapipe/framework/formats/matrix_data.pb.h"
#include "mediapipe/framework/formats/rect.pb.h"
#include "mediapipe/framework/formats/rect.pb.h"
#include "mediapipe/framework/formats/classification.pb.h"
#include "mediapipe/framework/formats/detection.pb.h"
#include "mediapipe/framework/formats/image_frame_opencv.h"
#include "mediapipe/framework/formats/matrix.h"
#include "mediapipe/framework/formats/matrix_data.pb.h"
#include "mediapipe/framework/formats/matrix_opencv.h"
#include "mediapipe/framework/formats/rect.pb.h"
#include "mediapipe/framework/formats/rect.pb.h"
#include "mediapipe/framework/formats/classification.pb.h"
#include "mediapipe/framework/formats/detection.pb.h"
#include "mediapipe/framework/formats/image_frame_opencv.h"
#include "mediapipe/framework/formats/rect.pb.h"
#include "mediapipe/framework/formats/rect.pb.h"
#include "mediapipe/framework/formats/classification.pb.h"
#include "mediapipe/framework/formats/detection.pb.h"
#include "mediapipe/framework/formats/image_frame_opencv.h"
#include "mediapipe/framework/formats/rect.pb.h"
#include "mediapipe/framework/formats/rect.pb.h"
#include "mediapipe/framework/formats/classification.pb.h"
#include "mediapipe/framework/formats/detection.pb.h"
#include "mediapipe/framework/formats/image_frame_opencv.h"
#include "mediapipe/framework/port/opencv_highgui_inc.h"
#include "mediapipe/framework/port/opencv_imgcodecs_inc.h"
#include "mediapipe/framework/port/opencv_video_inc.h"
#include "mediapipe/framework/port/opencv_videoio_inc.h"
#include "mediapipe/util/resource_util.h"
constexpr char kInputStream[] = "input_video";
constexpr char kOutputStream[] = "output_video";
constexpr char kLandmarksStream[] = "pose_landmarks";
constexpr char kWindowName[] = "MediaPipe";
using namespace mediapipe;
int main() {
// 初始化计算图
CalculatorGraphConfig config =
mediapipe::ParseTextProtoOrDie<CalculatorGraphConfig>(R"(
input_stream: "input_video"
output_stream: "output_video"
node {
calculator: "HolisticTrackingCalculator"
input_stream: "IMAGE:input_video"
output_stream: "IMAGE:output_video"
output_stream: "POSE_LANDMARKS:pose_landmarks"
node_options: {
[type.googleapis.com/mediapipe.HolisticTrackingCalculatorOptions] {
min_detection_confidence: 0.5
min_tracking_confidence: 0.5
}
}
}
)");
CalculatorGraph graph;
MP_RETURN_IF_ERROR(graph.Initialize(config));
// 打开摄像头或者视频文件
cv::VideoCapture capture;
capture.open(0);
cv::namedWindow(kWindowName, cv::WINDOW_NORMAL);
cv::resizeWindow(kWindowName, 720, 480);
// 处理帧数据
while (capture.isOpened()) {
bool grabbed = capture.grab();
if (!grabbed) break;
cv::Mat input_frame;
capture.retrieve(input_frame, cv::CAP_PROP_CONVERT_RGB);
// 将 OpenCV 的 Mat 数据转换成 MediaPipe 的 ImageFrame 数据
auto input_frame_mat = absl::make_unique<cv::Mat>(input_frame);
auto input_frame_image =
absl::make_unique<ImageFrame>(ImageFormat::SRGB, input_frame.cols,
input_frame.rows, ImageFrame::kDefaultAlignmentBoundary);
cv::Mat input_frame_mat_bgr;
cv::cvtColor(input_frame, input_frame_mat_bgr, cv::COLOR_RGB2BGR);
cv::Mat input_frame_mat_bgr_flipped;
cv::flip(input_frame_mat_bgr, input_frame_mat_bgr_flipped, /*flipcode=*/1);
cv::Mat input_frame_mat_bgr_flipped_aligned;
cv::Mat temp_output_frame = cv::Mat::zeros(input_frame_mat_bgr_flipped.rows, input_frame_mat_bgr_flipped.cols, input_frame_mat_bgr_flipped.type());
cv::rotate(input_frame_mat_bgr_flipped, temp_output_frame, cv::ROTATE_90_COUNTERCLOCKWISE);
cv::rotate(temp_output_frame, input_frame_mat_bgr_flipped_aligned, cv::ROTATE_180);
cv::Mat input_frame_mat_aligned;
cv::cvtColor(input_frame_mat_bgr_flipped_aligned, input_frame_mat_aligned, cv::COLOR_BGR2RGB);
memcpy(input_frame_image->MutablePixelData(), input_frame_mat_aligned.data,
input_frame_mat_aligned.total() * input_frame_mat_aligned.elemSize());
input_frame_image->SetColorSpace(ImageFrame::ColorSpace::SRGB);
input_frame_image->set_timestamp(Timestamp(capture.get(cv::CAP_PROP_POS_MSEC) * 1000));
// 向计算图输入数据
MP_RETURN_IF_ERROR(graph.AddPacketToInputStream(
kInputStream, Adopt(input_frame_image.release()).At(Timestamp(capture.get(cv::CAP_PROP_POS_MSEC) * 1000))));
// 获取输出结果
mediapipe::Packet pose_landmarks_packet;
if (graph.GetOutputLandmarkList(kLandmarksStream, &pose_landmarks_packet)) {
auto& pose_landmarks = pose_landmarks_packet.Get<mediapipe::NormalizedLandmarkList>();
if (pose_landmarks.landmark_size() > 0) {
// 获取右肩坐标
auto right_shoulder = pose_landmarks.landmark(11);
std::cout << "Right shoulder coordinate: (" << right_shoulder.x() << ", " << right_shoulder.y() << ", " << right_shoulder.z() << ")" << std::endl;
}
}
// 获取输出图像
mediapipe::Packet output_packet;
if (graph.GetOutputPacket(&output_packet, kOutputStream) && !output_packet.IsEmpty()) {
auto& output_frame = output_packet.Get<mediapipe::ImageFrame>();
cv::Mat output_mat = mediapipe::formats::MatView(&output_frame);
cv::Mat output_mat_bgr;
cv::cvtColor(output_mat, output_mat_bgr, cv::COLOR_RGB2BGR);
cv::Mat output_mat_bgr_flipped;
cv::flip(output_mat_bgr, output_mat_bgr_flipped, /*flipcode=*/0);
cv::imshow(kWindowName, output_mat_bgr_flipped);
}
if (cv::waitKey(5) == 27) break;
}
// 关闭计算图
MP_RETURN_IF_ERROR(graph.CloseInputStream(kInputStream));
return graph.WaitUntilDone();
}
```
需要注意的是,Holistic 模型输出的坐标值是归一化的坐标值,范围在[0, 1]之间。如果需要将其转换为图像坐标或者其他坐标系的坐标值,需要进行相应的转换。