单选题
31.在 ROS 机器人操作系统中,创建一个 Publisher ,发布的 topic 为”mytopic” ,msg 类型为
31.在 ROS 机器人操作系统中,创建一个 Publisher ,发布的 topic 为”mytopic” ,msg 类型为
std_msgs/ Int32 ,以下创建方法正确的是( )。
A
ros::NodeHandle nh;ros::Publisher pub = nh.advertise(”mytopic”, std_msgs::Int32, 10);
B
ros::NodeHandle nh;ros::Publisher pub = nh.advertise
C
ros::Publisher pub(”mytopic”, stdmsgs::Int32 ,10);
D
ros::Publisher答案解析
正确答案:B
