@@ -135,7 +135,7 @@ struct GimbalCmd
135135 // GimbalCmd(const std::string& vehicle_name,
136136 // const std::string& camera_name,
137137 // const msr::airlib::Quaternionr& target_quat) :
138- // vehicle_name(vehicle_name), camera_name(camera_name), target_quat(target_quat) {};AirsimROSWrapper
138+ // vehicle_name(vehicle_name), camera_name(camera_name), target_quat(target_quat) {};
139139};
140140
141141class AirsimROSWrapper
@@ -172,8 +172,11 @@ class AirsimROSWrapper
172172 ros::AsyncSpinner img_RGBD_async_spinner_;
173173 ros::AsyncSpinner img_stereo_async_spinner_;
174174 ros::AsyncSpinner img_bottom_async_spinner_;
175- ros::AsyncSpinner lidar_async_spinner_;
176- bool is_used_lidar_timer_cb_queue_;
175+ // ros::AsyncSpinner lidar_async_spinner_;
176+ ros::AsyncSpinner drone_state_async_spinner_;
177+ ros::AsyncSpinner command_listener_async_spinner_;
178+ // ros::AsyncSpinner update_commands_async_spinner_;
179+ // bool is_used_lidar_timer_cb_queue_;
177180 bool is_used_img_timer_cb_queue_;
178181
179182private:
@@ -262,28 +265,28 @@ class AirsimROSWrapper
262265 void img_response_RGBD_timer_cb (const ros::TimerEvent& event); // update images from airsim_client_ every nth sec
263266 void img_response_stereo_timer_cb (const ros::TimerEvent& event); // update images from airsim_client_ every nth sec
264267 void drone_state_timer_cb (const ros::TimerEvent& event); // update drone state from airsim_client_ every nth sec
265- void lidar_timer_cb (const ros::TimerEvent& event);
268+ // void lidar_timer_cb(const ros::TimerEvent& event);
266269
267270 // / ROS subscriber callbacks
268271 void pose_cmd_body_frame_cb (const airsim_ros_pkgs::PoseCmd::ConstPtr& msg, const std::string& vehicle_name);
269- void vel_cmd_world_frame_cb (const airsim_ros_pkgs::VelCmd::ConstPtr& msg, const std::string& vehicle_name);
272+ // void vel_cmd_world_frame_cb(const airsim_ros_pkgs::VelCmd::ConstPtr& msg, const std::string& vehicle_name);
270273 void vel_cmd_body_frame_cb (const airsim_ros_pkgs::VelCmd::ConstPtr& msg, const std::string& vehicle_name);
271274
272275 void angle_rate_throttle_frame_cb (const airsim_ros_pkgs::AngleRateThrottle::ConstPtr& msg, const std::string& vehicle_name);
273276
274- void vel_cmd_group_body_frame_cb (const airsim_ros_pkgs::VelCmdGroup& msg);
275- void vel_cmd_group_world_frame_cb (const airsim_ros_pkgs::VelCmdGroup& msg);
277+ // void vel_cmd_group_body_frame_cb(const airsim_ros_pkgs::VelCmdGroup& msg);
278+ // void vel_cmd_group_world_frame_cb(const airsim_ros_pkgs::VelCmdGroup& msg);
276279
277- void vel_cmd_all_world_frame_cb (const airsim_ros_pkgs::VelCmd& msg);
278- void vel_cmd_all_body_frame_cb (const airsim_ros_pkgs::VelCmd& msg);
280+ // void vel_cmd_all_world_frame_cb(const airsim_ros_pkgs::VelCmd& msg);
281+ // void vel_cmd_all_body_frame_cb(const airsim_ros_pkgs::VelCmd& msg);
279282
280283 // void vel_cmd_body_frame_cb(const airsim_ros_pkgs::VelCmd& msg, const std::string& vehicle_name);
281284 void gimbal_angle_quat_cmd_cb (const airsim_ros_pkgs::GimbalAngleQuatCmd& gimbal_angle_quat_cmd_msg);
282285 void gimbal_angle_euler_cmd_cb (const airsim_ros_pkgs::GimbalAngleEulerCmd& gimbal_angle_euler_cmd_msg);
283286
284287 // commands
285288 void car_cmd_cb (const airsim_ros_pkgs::CarControls::ConstPtr& msg, const std::string& vehicle_name);
286- void update_commands ();
289+ // void update_commands(const ros::TimerEvent& event );
287290
288291 // state, returns the simulation timestamp best guess based on drone state timestamp, airsim needs to return timestap for environment
289292 ros::Time update_state ();
@@ -292,16 +295,16 @@ class AirsimROSWrapper
292295
293296 // / ROS service callbacks
294297 bool takeoff_srv_cb (airsim_ros_pkgs::Takeoff::Request& request, airsim_ros_pkgs::Takeoff::Response& response, const std::string& vehicle_name);
295- bool takeoff_group_srv_cb (airsim_ros_pkgs::TakeoffGroup::Request& request, airsim_ros_pkgs::TakeoffGroup::Response& response);
296- bool takeoff_all_srv_cb (airsim_ros_pkgs::Takeoff::Request& request, airsim_ros_pkgs::Takeoff::Response& response);
298+ // bool takeoff_group_srv_cb(airsim_ros_pkgs::TakeoffGroup::Request& request, airsim_ros_pkgs::TakeoffGroup::Response& response);
299+ // bool takeoff_all_srv_cb(airsim_ros_pkgs::Takeoff::Request& request, airsim_ros_pkgs::Takeoff::Response& response);
297300 bool land_srv_cb (airsim_ros_pkgs::Land::Request& request, airsim_ros_pkgs::Land::Response& response, const std::string& vehicle_name);
298- bool land_group_srv_cb (airsim_ros_pkgs::LandGroup::Request& request, airsim_ros_pkgs::LandGroup::Response& response);
299- bool land_all_srv_cb (airsim_ros_pkgs::Land::Request& request, airsim_ros_pkgs::Land::Response& response);
300- bool reset_srv_cb (airsim_ros_pkgs::Reset::Request& request, airsim_ros_pkgs::Reset::Response& response);
301+ // bool land_group_srv_cb(airsim_ros_pkgs::LandGroup::Request& request, airsim_ros_pkgs::LandGroup::Response& response);
302+ // bool land_all_srv_cb(airsim_ros_pkgs::Land::Request& request, airsim_ros_pkgs::Land::Response& response);
303+ // bool reset_srv_cb(airsim_ros_pkgs::Reset::Request& request, airsim_ros_pkgs::Reset::Response& response);
301304
302305 // / ROS tf broadcasters
303- void publish_camera_tf (const ImageResponse& img_response, const ros::Time& ros_time, const std::string& frame_id, const std::string& child_frame_id);
304- void publish_odom_tf (const nav_msgs::Odometry& odom_msg);
306+ // void publish_camera_tf(const ImageResponse& img_response, const ros::Time& ros_time, const std::string& frame_id, const std::string& child_frame_id);
307+ // void publish_odom_tf(const nav_msgs::Odometry& odom_msg);
305308
306309 // / camera helper methods
307310 sensor_msgs::CameraInfo generate_cam_info (const std::string& camera_name, const CameraSetting& camera_setting, const CaptureSetting& capture_setting) const ;
@@ -358,16 +361,16 @@ class AirsimROSWrapper
358361 std::string host_ip_;
359362
360363 // subscriber / services for ALL robots
361- ros::Subscriber vel_cmd_all_body_frame_sub_;
362- ros::Subscriber vel_cmd_all_world_frame_sub_;
363- ros::ServiceServer takeoff_all_srvr_;
364- ros::ServiceServer land_all_srvr_;
364+ // ros::Subscriber vel_cmd_all_body_frame_sub_;
365+ // ros::Subscriber vel_cmd_all_world_frame_sub_;
366+ // ros::ServiceServer takeoff_all_srvr_;
367+ // ros::ServiceServer land_all_srvr_;
365368
366369 // todo - subscriber / services for a GROUP of robots, which is defined by a list of `vehicle_name`s passed in the ros msg / srv request
367- ros::Subscriber vel_cmd_group_body_frame_sub_;
368- ros::Subscriber vel_cmd_group_world_frame_sub_;
369- ros::ServiceServer takeoff_group_srvr_;
370- ros::ServiceServer land_group_srvr_;
370+ // ros::Subscriber vel_cmd_group_body_frame_sub_;
371+ // ros::Subscriber vel_cmd_group_world_frame_sub_;
372+ // ros::ServiceServer takeoff_group_srvr_;
373+ // ros::ServiceServer land_group_srvr_;
371374
372375 AIRSIM_MODE airsim_mode_ = AIRSIM_MODE::DRONE;
373376
@@ -385,15 +388,20 @@ class AirsimROSWrapper
385388 std::unique_ptr<msr::airlib::RpcLibClientBase> airsim_client_ = nullptr ;
386389 // seperate busy connections to airsim, update in their own thread
387390 msr::airlib::RpcLibClientBase airsim_client_images_;
388- msr::airlib::RpcLibClientBase airsim_client_lidar_;
391+ msr::airlib::MultirotorRpcLibClient airsim_client_states_;
392+ // msr::airlib::RpcLibClientBase airsim_client_lidar_;
389393
390394 // todo not sure if async spinners shuold be inside this class, or should be instantiated in airsim_node.cpp, and cb queues should be public
391395 // todo for multiple drones with multiple sensors, this won't scale. make it a part of VehicleROS?
392396 ros::CallbackQueue img_timer_cb_queue_;
393397 ros::CallbackQueue img_timer_cb_queue_RGBD_;
394398 ros::CallbackQueue img_timer_cb_queue_stereo_;
395399 ros::CallbackQueue img_timer_cb_queue_bottom_;
396- ros::CallbackQueue lidar_timer_cb_queue_;
400+ // ros::CallbackQueue lidar_timer_cb_queue_;
401+ ros::CallbackQueue drone_state_timer_cb_queue_;
402+ ros::CallbackQueue command_listener_queue_;
403+ // ros::CallbackQueue default_queue_;
404+ // ros::CallbackQueue update_commands_queue_;
397405
398406 bool img_cb_flag = 0 ;
399407
@@ -418,14 +426,17 @@ class AirsimROSWrapper
418426
419427 // / ROS params
420428 double vel_cmd_duration_;
421-
429+
430+ long long last_cmd_time;
431+
422432 // / ROS Timers.
423433 ros::Timer airsim_img_response_timer_;
424434 ros::Timer airsim_img_response_bottom_timer_;
425435 ros::Timer airsim_img_response_RGBD_timer_;
426436 ros::Timer airsim_img_response_stereo_timer_;
427437 ros::Timer airsim_control_update_timer_;
428- ros::Timer airsim_lidar_update_timer_;
438+ // ros::Timer airsim_control_update_timer2_;
439+ // ros::Timer airsim_lidar_update_timer_;
429440
430441 typedef std::pair<std::vector<ImageRequest>, std::string> airsim_img_request_vehicle_name_pair;
431442 std::vector<airsim_img_request_vehicle_name_pair> airsim_img_request_vehicle_name_pair_vec_;
0 commit comments