创建一个Publisher,发布的topic为"mytopic", msg类型为std_msgs/Int32 以下创建方法正确的是:()。
A.ros::NodeHandle nh; ros::Publisher pub = nh.advertise﹤std_msgs::Int32﹥("mytopic", 10);
B.ros::Publisher﹤std_msgs::Int32﹥ pub("mytopic", 10);
C.ros::Publisher pub("mytopic", std_msgs::Int32,10);
D.ros::NodeHandle nh; ros::Publisher pub = nh.advertise("mytopic", std_msgs::Int32,10);