单项选择题
创建一个Publisher,发布的topic为"mytopic", msg类型为std_msgs/Int32
以下创建方法正确的是:
A.ros::NodeHandle nh;
ros::Publisher pub = nh.advertise("mytopic", std_msgs::Int32,10);B.ros::Publisher pub("mytopic", std_msgs::Int32,10);
C.ros::Publisher pub("mytopic", 10);
D.ros::NodeHandle nh; ros::Publisher pub = nh.advertise("mytopic", 10);
点击查看答案&解析
