aaa

Dependencies:   mbed BNO055_fusion Adafruit_GFX ros_lib_kinetic

Revision:
3:a45557a0dcb8
Parent:
1:bdd17feaa4ce
Child:
4:cf1a4e503974
--- a/myRos.cpp	Fri Dec 07 22:34:31 2018 +0000
+++ b/myRos.cpp	Tue Dec 11 17:51:47 2018 +0000
@@ -12,7 +12,7 @@
 }
 
 void My_Ros::initialize(){
-    ack_from_pc_ = false;
+    ack_from_pc_ = true;
 }
 
 void My_Ros::court_color_publisher(){
@@ -31,21 +31,21 @@
 
 void My_Ros::initial_pose_publisher(){
     static geometry_msgs::Point initial_pose;
-    static ros::Publisher initial_pose_pub("nucleo/initial_point", &initial_pose);
+    static ros::Publisher initial_pose_pub("nucleo/initial_pose", &initial_pose);
     
     static bool init_flag = false;
     if(init_flag == false){
         nh_.advertise(initial_pose_pub);    
         init_flag = true;
     }
-   
-    initial_pose = initial_pose_.get_point_msgs();
+ 
+    initial_pose = get_initial_pose().get_point_msgs();
     initial_pose_pub.publish(&initial_pose);
 }
 
 void My_Ros::pose_publisher(){
     static geometry_msgs::Point pose;
-    static ros::Publisher pose_pub("nucleo/point", &pose);
+    static ros::Publisher pose_pub("nucleo/pose", &pose);
     
     static bool init_flag = false;
     if(init_flag == false){
@@ -53,25 +53,20 @@
         init_flag = true;
     }
    
-    pose = pose_.get_point_msgs();
+    pose = get_pose().get_point_msgs();
     pose_pub.publish(&pose);
 }
 
-//loopで回す
-//
-void My_Ros::set_amcl_parameter(){
-     //Send initialize
+//This function run every 10 msec at main
+void My_Ros::loop(){
     if(ack_from_pc_ == false){
+        //Send initialize
         court_color_publisher();
         initial_pose_publisher();
     }
     
     //Send current position(odom -> base_footprint)
-    pose_publisher();   
-}
-
-//This function run every 10 msec at main
-void My_Ros::loop(){
-    set_amcl_parameter();
+    pose_publisher(); 
+    
     nh_.spinOnce();
 }
\ No newline at end of file