我使用的astra_camera包启动的astra s相机,rviz中最坐标的为rgb_optical_frame坐标系,中间为rgb_optical_frame,最右边为camera_link坐标系, 按照客服的解答camera_link对应相机的中点,那么真实的情况不应该是camera_link在最左边吗,求解
重要提示
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
小元不圆 发布的帖子
-
在ros中使用astra s相机坐标系和真实的坐标系不一致
-
RE: 机械臂如何在运动规划完成后,对物体进行抓取
@吴凯荣 我刚刚尝试了一下,如果给夹爪一个固定的角度,xyz由moveit来求解,运动规划的时候经常求不出来解,很难受。似乎不可行
-
RE: 机械臂如何在运动规划完成后,对物体进行抓取
@吴凯荣 那请问一下,我目前的是不是可以给定机械臂的末端一个固定的oritation值作为抓取的姿态,然后transformlation值 由目标物体的位置来决定。
-
机械臂如何在运动规划完成后,对物体进行抓取
我想请问一下,使用moveit运动学插件后,只能使机械臂的夹爪到达目标物体的位置,但是要实现抓取还要让夹爪等一些关节调整到能抓取的角度该如何实现。希望能抓取一些方块,书等物体,需要进行抓取姿态分析吗?这是我的机械臂的样子
-
RE: 如何实现机械臂的视觉抓取
@小元不圆 可以帮我检查一下我的坐标系,是不是对的吗,感觉最后得到的坐标系变换结果不对,最粗的那个坐标系是机械臂基座的,坐标的细线坐标系是相机的,右边的细线坐标系是物体的。
-
如何实现机械臂的视觉抓取
关于机械臂的视觉抓取
1.我的配置
(1)6个舵机的机械臂
(2)astra s深度相机
(3)stm32板
2.视觉抓取的流程
(1)相机的内参标定(已完成)
(2)手眼标定获取(眼在手外)机械臂底座和相机的tf变化关系(已完成)
(3)物体识别 获取相机坐标系下目标物体的tf变换(已完成)
(4)抓取该物体第四步我不知道该怎么去入手,是不是知道目标物体和机械臂基座的变化关系后就可以实现抓取了,还是要继续知道物体的长宽高,希望得到一个清晰的思路,谢谢了!
-
RE: opencv 如何用c++实现像素坐标转相机坐标
@小元不圆
这是我的代码,我把输入和输出全部打印出来后,得到的果全是nan。
#include "ros/ros.h"
#include "tf2_ros/transform_broadcaster.h"
#include "tf2/LinearMath/Quaternion.h"
#include "tf/transform_listener.h"
#include "std_msgs/Float32MultiArray.h"
#include <opencv2/opencv.hpp>
#include <iostream>
using namespace cv;
using namespace std;
vector<vector<double>> MK;
vector<double> MD;
double num1[3][5] = {{467.973718746897, 0, 303.2622606570868},
{0, 452.261907941113, 251.781457549611},
{0,0,1},
};
double num2[5] = {0.1162199830512324, -0.1111997240485036,
-0.007053489238768723, 0.006914931854427629, 0};void pixel_to_camera(double arr[],float depth){
vector<double> points(arr,arr+2);
vector<Point2f> MP;cv::Mat inp1(1, 2, CV_64FC2,arr), inp2(1, 1, CV_64FC2); cv::Mat outp1, outp2; cv::Mat m1(3,3,CV_64F,num1); cv::Mat m2(1,5,CV_64F,num2); cv::undistortPoints(inp1,outp1,m1,m2); cout<<"inp1\n"<<inp1<<endl; cout<<"outp1\n"<<outp1<<endl; cout<<"m1\n"<<m1<<endl; cout<<"m2\n"<<m2<<endl;
int main(int argc,char *argv[]){
ros::init(argc,argv,"tf_pub_dynamic");
ros::NodeHandle nh;
double arr[2] = {286.0,198.0};
int *result;
pixel_to_camera(arr,1.0);
return 0;
}
-
RE: opencv 如何用c++实现像素坐标转相机坐标
@小鱼 鱼哥,我按照你给的例子把参数类型全部换成了mat类型可是还是报错了,不过报错变了
terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.2.0) ../modules/calib3d/src/undistort.dispatch.cpp:283: error: (-215:Assertion failed) CV_IS_MAT(_cameraMatrix) && _cameraMatrix->rows == 3 && _cameraMatrix->cols == 3 in function 'cvUndistortPointsInternal'Aborted (core dumped)
#include "ros/ros.h"
#include "tf2_ros/transform_broadcaster.h"
#include "tf2/LinearMath/Quaternion.h"
#include "tf/transform_listener.h"
#include "std_msgs/Float32MultiArray.h"
#include <opencv2/opencv.hpp>
#include <iostream>
using namespace cv;
using namespace std;double num1[3][5] = {{467.973718746897, 0, 303.2622606570868},
{0, 452.261907941113, 251.781457549611},
{0,0,1},
};
double num2[5] = {0.1162199830512324, -0.1111997240485036,
-0.007053489238768723, 0.006914931854427629, 0};
void pixel_to_camera(double arr[],float depth){
vector<double> points(arr,arr+2);
vector<Point2f> MP;cv::Mat inp1(1, 1, CV_64FC2,arr), inp2(1, 1, CV_64FC2); cv::Mat outp1, outp2; cv::Mat m1(3,5,CV_64F,num1); cv::Mat m2(1,5,CV_64F,num2); cv::undistortPoints(inp1,outp1,m1,m2);
int main(int argc,char *argv[]){
ros::init(argc,argv,"tf_pub_dynamic");
ros::NodeHandle nh;double arr[2] = {286.0,198.0}; int *result; pixel_to_camera(arr,1.0); return 0;
}
-
RE: opencv 如何用c++实现像素坐标转相机坐标
@小鱼 我想请问下,terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.2.0) ../modules/core/src/matrix_wrap.cpp:79: error: (-215:Assertion failed) 0 <= i && i < (int)vv.size() in function 'getMat_'
我编译通过但是运行报错,这大概是什么原因
#include "ros/ros.h"
#include "tf2_ros/transform_broadcaster.h"
#include "tf2/LinearMath/Quaternion.h"
#include "tf/transform_listener.h"
#include "std_msgs/Float32MultiArray.h"
#include <opencv2/opencv.hpp>
#include <iostream>
using namespace cv;
using namespace std;
vector<vector<double>> MK;
vector<double> MD;void pixel_to_camera(double arr[],float depth){
vector<double> points(arr,arr+2);
vector<Point2f> MP;
cv::undistortPoints(points,MP,MK,MD,cv::noArray(),cv::noArray());
int main(int argc,char *argv[]){
ros::init(argc,argv,"tf_pub_dynamic");
ros::NodeHandle nh;
double c1[3] = {467.973718746897, 0, 303.2622606570868};
double c2[3] = {0, 452.261907941113, 251.781457549611};
double c3[3] = {0, 0, 1};
vector<double> c1_v(c1,c1+3);
vector<double> c2_v(c2,c2+3);
vector<double> c3_v(c3,c3+3);
MK.push_back(c1_v);
MK.push_back(c2_v);
MK.push_back(c3_v);double d1[5]={0.1162199830512324, -0.1111997240485036, -0.007053489238768723, 0.006914931854427629, 0}; for(int i = 0;i<5;i++){ MD.push_back(d1[i]); } double arr[2] = {286.0,198.0}; int *result; pixel_to_camera(arr,1.0); return 0;
}