Make default camera and navdata states consistent during init.

Esse commit está contido em:
Mani Monajjemi
2012-05-16 15:23:13 -07:00
commit 20cc090b7b
3 arquivos alterados com 11 adições e 8 exclusões
+4 -5
Ver Arquivo
@@ -18,9 +18,8 @@ ARDroneDriver::ARDroneDriver()
//toggleCam_sub = node_handle.subscribe("/ardrone/togglecam", 10, &toggleCamCallback);
#ifdef _USING_SDK_1_7_
//Ensure that the horizontal camera is running
int cam_state = 0; // horizontal
int set_navdata_demo_value = 1;
int cam_state = DEFAULT_CAM_STATE; // 0 for forward and 1 for vertical, change to enum later
int set_navdata_demo_value = DEFAULT_NAVDATA_DEMO;
ARDRONE_TOOL_CONFIGURATION_ADDEVENT (video_channel, &cam_state, NULL);
ARDRONE_TOOL_CONFIGURATION_ADDEVENT (navdata_demo, &set_navdata_demo_value, NULL);
#else
@@ -41,13 +40,13 @@ void ARDroneDriver::run()
ros::Rate loop_rate(40);
int configWate = 250;
int cam_state = 0; // horizontal
int set_navdata_demo_value = 1; // Low bandwidth usage
bool configDone = false;
//These are some extra params (experimental)
int mCodec = P264_CODEC;
int vbcMode = VBC_MODE_DYNAMIC;
int cam_state = DEFAULT_CAM_STATE; // 0 for forward and 1 for vertical, change to enum later
int set_navdata_demo_value = DEFAULT_NAVDATA_DEMO;
while (node_handle.ok())
{
+2 -3
Ver Arquivo
@@ -7,9 +7,8 @@ bool is_flying = false;
bool needs_reset = false;
geometry_msgs::Twist cmd_vel;
int cam_state = 0; // 0 for forward and 1 for vertical, change to enum later
int set_navdata_demo_value = TRUE;
int cam_state = DEFAULT_CAM_STATE; // 0 for forward and 1 for vertical, change to enum later
int set_navdata_demo_value = DEFAULT_NAVDATA_DEMO;
bool toggleNavdataDemoCallback(std_srvs::Empty::Request& request, std_srvs::Empty::Response& response)
{
+5
Ver Arquivo
@@ -19,5 +19,10 @@ void takeoffCallback(const std_msgs::Empty &msg);
bool toggleCamCallback(std_srvs::Empty::Request& request, std_srvs::Empty::Response& response);
bool toggleNavdataDemoCallback(std_srvs::Empty::Request& request, std_srvs::Empty::Response& response);
//All global drone configs that should be sent on init
#define DEFAULT_CAM_STATE 0
#define DEFAULT_NAVDATA_DEMO 1
#endif