题目:在 ROS 机器人操作系统中,创建一个 Publisher,发布的 topic 为"mytopic",msg 类型为std_msgs/Int32,以下创建方法正确的是( )
A. ros::Publisher pub("mytopic", 10);
B. ros::Publisher pub("mytopic", std_msgs::Int32,10);
C. ros::NodeHandle nh;ros::Publisher pub = nh.advertise("mytopic", std_msgs::Int32,10);
D. ros::NodeHandle nh;ros::Publisher pub = nh.advertise ("mytopic", 10);
答案:评论后可见此内容