0
저는 ROS에서 꽤 새로운입니다.ROS에 메시지를 보내는데 문제가 발생했습니다.
#include "stdafx.h"
#include "ros.h"
#include <string>
#include <stdio.h>
#include <Windows.h>
using std::string;
int _tmain(int argc, _TCHAR * argv[])
{
ros::NodeHandle nh;
char *ros_master = "*.*.*.*";
printf("Connecting to server at %s\n", ros_master);
nh.initNode(ros_master);
printf("Advertising cmd_vel message\n");
string sent = "Hello robot";
ros::Publisher cmd_vel_pub("try", sent);
nh.advertise(cmd_vel_pub);
printf("All done!\n");
return 0;
}
컴파일러는 나에게 이러한 오류 제공 : 난 그냥이 코드를 리눅스 서버 노드에 메시지를 게시하려고 내가 비주얼 스튜디오 오전
Error C2664 'ros::Publisher::Publisher(ros::Publisher &&)': cannot convert argument 2 from 'std::string' to 'ros::Msg *' LeapMotion c:\users\vive-vr-pc\documents\visual studio 2015\projects\leapmotion\leapmotion\leapmotion.cpp 22
Error (active) no instance of constructor "ros::Publisher::Publisher" matches the argument list LeapMotion c:\Users\Vive-VR-PC\Documents\Visual Studio 2015\Projects\LeapMotion\LeapMotion\LeapMotion.cpp 22
을 거기되지 않습니다 윈도우에서 리눅스까지 많은 튜토리얼이있어서, 무엇을해야할지 혼란 스럽다. 많은 도움에 감사드립니다! : D
귀하의 질문에 답변 되었습니까? – cassinaj