From a55662ff3e27d0ed77a73035843526e1c3ed4875 Mon Sep 17 00:00:00 2001 From: vivek-shankar Date: Fri, 17 Feb 2017 16:41:50 -0500 Subject: [PATCH] merge conflict fix --- CMakeLists.txt | 20 +---------- include/CommunicationManager.h | 60 --------------------------------- include/MultithreadingDeque.hpp | 4 --- include/SerialDevice.h | 12 ------- include/XBeeFrame.h | 7 ---- 5 files changed, 1 insertion(+), 102 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ae971cb..a4fb046 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,32 +53,19 @@ include_directories( ) -<<<<<<< HEAD -add_executable(xbee_mav src/Xbee.cpp src/XBeeFrame.cpp src/SerialDevice.cpp src/CommunicationManager.cpp) -target_link_libraries(xbee_mav ${catkin_LIBRARIES}) -add_executable(config src/main.cpp src/XBeeModule.cpp src/XMLConfigParser.cpp) -target_link_libraries(config ${catkin_LIBRARIES}) -======= add_executable(xbee_mav src/Xbee.cpp src/XBeeFrame.cpp src/SerialDevice.cpp src/CommunicationManager.cpp src/PacketsHandler) target_link_libraries(xbee_mav ${catkin_LIBRARIES}) #add_executable(config src/main.cpp src/XBeeModule.cpp src/XMLConfigParser.cpp) #target_link_libraries(config ${catkin_LIBRARIES}) ->>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1 #add_executable(test_controller src/TestController.cpp) #target_link_libraries(test_controller ${catkin_LIBRARIES}) -<<<<<<< HEAD -#add_executable(test_buzz src/TestBuzz.cpp) -#target_link_libraries(test_buzz ${catkin_LIBRARIES}) -======= + add_executable(test_buzz src/TestBuzz.cpp) target_link_libraries(test_buzz ${catkin_LIBRARIES}) ->>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1 - - ############# ## Install ## @@ -89,9 +76,4 @@ target_link_libraries(test_buzz ${catkin_LIBRARIES}) ############# ## Testing ## ############# -<<<<<<< HEAD - - -======= ->>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1 diff --git a/include/CommunicationManager.h b/include/CommunicationManager.h index cfa0da1..1bbf6bb 100644 --- a/include/CommunicationManager.h +++ b/include/CommunicationManager.h @@ -1,10 +1,6 @@ /* CommunicationManager.h -- Communication Manager class for XBee: Handles all communications with other ROS nodes -<<<<<<< HEAD - and the serial port -- */ -======= and the serial port -- */ ->>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1 /* ------------------------------------------------------------------------- */ /* September 20, 2016 -- @Copyright Aymen Soussia. All rights reserved. */ /* (aymen.soussia@gmail.com) */ @@ -20,18 +16,9 @@ #include #include -<<<<<<< HEAD -#include"SerialDevice.h" - -#define MESSAGE_CONSTANT 238 -#define ACK_MESSAGE_CONSTANT 911 -#define XBEE_MESSAGE_CONSTANT 586782343 -#define XBEE_STOP_TRANSMISSION 4355356352 -======= #include"PacketsHandler.h" #include"SerialDevice.h" ->>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1 namespace Mist { @@ -72,30 +59,14 @@ private: void Run_In_Solo_Mode(DRONE_TYPE drone_type); void Run_In_Swarm_Mode(); -<<<<<<< HEAD - void Generate_Transmit_Request_Frame( - const char* const message, - std::string* frame, - int tot, -======= /*void Generate_Transmit_Request_Frame( const char* const message, std::string* frame, ->>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1 const unsigned char frame_ID = static_cast(0x01), const std::string& destination_adssress = "000000000000FFFF", const std::string& short_destination_adress = "FFFF", const std::string& broadcast_radius = "00", -<<<<<<< HEAD - const std::string& options = "00"); - void Check_In_Messages_and_Transfer_To_Topics(); - void Display_Init_Communication_Failure(); - void Convert_HEX_To_Bytes(const std::string& HEX_data, - std::string* converted_data); - void Calculate_and_Append_Checksum(std::string* frame); - void Add_Length_and_Start_Delimiter(std::string* frame); -======= const std::string& options = "00");*/ //void Check_In_Messages_and_Transfer_To_Topics(); void Display_Init_Communication_Failure(); @@ -103,7 +74,6 @@ private: //std::string* converted_data); //void Calculate_and_Append_Checksum(std::string* frame); //void Add_Length_and_Start_Delimiter(std::string* frame); ->>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1 void Send_Mavlink_Message_Callback( const mavros_msgs::Mavlink::ConstPtr& mavlink_msg); void Display_Drone_Type_and_Running_Mode(DRONE_TYPE drone_type, @@ -111,12 +81,6 @@ private: bool Serve_Flight_Controller(mavros_msgs::CommandInt:: Request& request, mavros_msgs::CommandInt::Response& response); void Check_In_Messages_and_Transfer_To_Server(); -<<<<<<< HEAD - unsigned short Caculate_Checksum(std::string* frame); - void Send_multi_msg(); - Mist::Xbee::SerialDevice serial_device_; - Thread_Safe_Deque* in_messages_; -======= void Process_In_Standard_Messages(); void Process_In_Acks_and_Pings(); void Process_In_Fragments(); @@ -130,36 +94,12 @@ private: Thread_Safe_Deque in_Acks_and_Pings_; Thread_Safe_Deque command_responses_; Thread_Safe_Deque in_packets_; ->>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1 ros::NodeHandle node_handle_; ros::Subscriber mavlink_subscriber_; ros::Publisher mavlink_publisher_; ros::ServiceClient mav_dji_client_; ros::ServiceServer mav_dji_server_; -<<<<<<< HEAD - /*No of robots*/ - int no_of_dev; - int device_id; - /*Vector msgs*/ - std::map< std::size_t, std::shared_ptr > multi_msgs_receive; - std::vector multi_msgs_send_dict; - /*Sending param*/ - uint16_t sending_chunk_no, Sender_cur_checksum; - std::map< uint16_t, uint16_t > ack_received_dict; - //std::vector multi_msgs_send_counter; - //std::vector multi_msgs_sender; - /*Receiving param*/ - uint16_t receiver_cur_checksum; - uint16_t counter; //After implementation change this to vector.size() - uint16_t receiveing_cur_totalsize; - uint16_t steps; - //uint16_t multi_msg_size; - uint64_t message_obtmulti[600]; - //int test_1; - //struct timeval t1, t2; -======= std::shared_ptr service_thread_; // TO DO delete !? ->>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1 }; diff --git a/include/MultithreadingDeque.hpp b/include/MultithreadingDeque.hpp index 6d0e80d..ea9aa6a 100644 --- a/include/MultithreadingDeque.hpp +++ b/include/MultithreadingDeque.hpp @@ -36,11 +36,7 @@ public: //**************************************************************************** -<<<<<<< HEAD - void Push_Pack(const _T& new_data) -======= void Push_Back(const _T& new_data) ->>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1 { std::lock_guard guard(mutex_); deque_.push_back(new_data); diff --git a/include/SerialDevice.h b/include/SerialDevice.h index 0012c13..25333cf 100644 --- a/include/SerialDevice.h +++ b/include/SerialDevice.h @@ -25,9 +25,6 @@ namespace Xbee { -<<<<<<< HEAD -typedef MultithreadingDeque> Thread_Safe_Deque; -======= struct Out_Packet_S { uint8_t packet_ID_; @@ -36,7 +33,6 @@ struct Out_Packet_S typedef MultithreadingDeque> Thread_Safe_Deque; typedef MultithreadingDeque Thread_Safe_Deque_Of_Vectors; ->>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1 //***************************************************************************** @@ -50,9 +46,6 @@ public: void Send_Frame(const std::string& frame); void Run_Service(); void Stop_Service(); -<<<<<<< HEAD - Thread_Safe_Deque* Get_In_Messages_Pointer(); -======= void Set_In_Messages_Pointers(Thread_Safe_Deque* in_std_messages, Thread_Safe_Deque* in_fragments, Thread_Safe_Deque* in_Acks_and_Pings, @@ -60,7 +53,6 @@ public: bool Is_IO_Service_Stopped(); // TO DO delete this function void Reset_IO_Service(); // TO DO delete this function void Close_Serial_Port(); ->>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1 private: @@ -92,14 +84,10 @@ private: boost::asio::io_service io_service_; boost::asio::serial_port serial_port_; std::deque out_messages_; -<<<<<<< HEAD - Thread_Safe_Deque in_messages_; -======= Thread_Safe_Deque* in_std_messages_; Thread_Safe_Deque* in_fragments_; Thread_Safe_Deque* in_Acks_and_Pings_; Thread_Safe_Deque* command_responses_; ->>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1 Mist::Xbee::Frame current_frame_; unsigned int FRAME_TYPE_KEYS[REMOTE_AT_COMMAND_RESPONSE + 1]; }; diff --git a/include/XBeeFrame.h b/include/XBeeFrame.h index c7073b0..50ed2b3 100644 --- a/include/XBeeFrame.h +++ b/include/XBeeFrame.h @@ -27,11 +27,7 @@ public: ~Frame(); enum {FRAME_HEADER_LENGTH = 4}; -<<<<<<< HEAD - enum {MAX_FRAME_BODY_LENGTH = 280}; // TO DO check value -======= enum {MAX_FRAME_BODY_LENGTH = 270}; // TO DO check value ->>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1 const char* Get_Frame_Data() const; char* Get_Frame_Data(); @@ -43,10 +39,7 @@ public: std::size_t Get_Frame_Type() const; int Get_Start_Delimiter_Position(); void Rearrange_Corrupted_Header(); -<<<<<<< HEAD -======= char Get_Message_Type(); // TO DO const !? ->>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1 private: