// guess what int main(int argc, const char *argv[]) { // if called without any arguments, show usage info (not full help) if(argc == 1) show_help_and_exit(); msg_stream = stderr; cliargs_init(argc, argv); DynaBuf_init();// inits *global* dynamic buffer - important, so first // Init platform-specific stuff. // For example, this could read the library path from an // environment variable, which in turn may need DynaBuf already. PLATFORM_INIT; // init some keyword trees needed for argument handling CPUtype_init(); Outputfile_init(); // handle command line arguments cliargs_handle_options(short_option, long_option); // generate list of files to process cliargs_get_rest(&toplevel_src_count, &toplevel_sources, "No top level sources given"); // Init modules (most of them will just build keyword trees) ALU_init(); Basics_init(); CPU_init(); Encoding_init(); Flow_init(); Input_init(); Label_init(); Macro_init(); Mnemo_init(); Output_init(fill_value); Section_init(); if(do_actual_work()) save_output_file(); return(ACME_finalize(EXIT_SUCCESS)); // dump labels, if wanted }
void second_straight_factory_init(){ ControllerWeight use_controller; SwitchTerm switch_term; int balancing_requrement =0; int target_tail_angle=0; int gyroOffsetRevise=0; int request_forced_stop =0; MovementDirection movementDirection = FORWARD; //stableRunningMethod use_controller.target_curvature_controller_weight = 0.5; use_controller.target_light_controller_weight = 0.5; switch_term.distance = 1330.0; switch_term.inclination = 0; switch_term.inPushed = 0; switch_term.speed = 0; switch_term.time =0; balancing_requrement = 1; target_tail_angle=0; gyroOffsetRevise=0; request_forced_stop = 0; movementDirection = FORWARD; RunningMethod_init(&secondStraightLineTraceMethod,balancing_requrement,use_controller,target_tail_angle, gyroOffsetRevise,switch_term,DistanceSwitch_judge_switch_method,request_forced_stop,movementDirection); second_straight_running_method_array[0]=secondStraightLineTraceMethod; int number_of_running_method=1; TargetValues target_values; target_values.target_brightness = 0.5; target_values.target_curvature = 0.0; target_values.target_speed = 400; Section *nextSection = &secondCurve_1; Section_init(&secondStraight,nextSection,number_of_running_method,second_straight_running_method_array,target_values); }
void thurd_straight_factory_init() { //Section Local variables TargetValues target_values; Section *nextSection; RunningMethod *runningMethod; //RunningMethod Local Variables ControllerWeight use_controller; SwitchTerm switch_term; int number_of_running_method=0; int balancing_requrement =1; int target_tail_angle=0; int gyroOffsetRevise=0; int request_forced_stop = 0; int (*fp_SwitchJudge)(SwitchTerm); MovementDirection movementDirection = FORWARD; use_controller.target_curvature_controller_weight = 0.4; use_controller.target_light_controller_weight = 0.6; //switch_term.distance = 400; switch_term.distance = 512.89; switch_term.distance = 680.89; switch_term.inclination = 0; switch_term.inPushed = 0; switch_term.speed = 0; switch_term.time =0; balancing_requrement = 1; target_tail_angle=0; gyroOffsetRevise=0; request_forced_stop = 0; movementDirection = FORWARD; fp_SwitchJudge = DistanceSwitch_judge_switch_method; RunningMethod_init(&thurdStraightLineTraceMethod,balancing_requrement,use_controller,target_tail_angle, gyroOffsetRevise,switch_term,fp_SwitchJudge,request_forced_stop,movementDirection); //secondCurve_3 Section thurd_straight_running_method_array[0]=thurdStraightLineTraceMethod; runningMethod = thurd_straight_running_method_array; number_of_running_method=1; target_values.target_brightness = 0.5; target_values.target_curvature = 0; target_values.target_speed = 400; nextSection = &thurdCurve_1; Section_init(&thurdStraight,nextSection,number_of_running_method,runningMethod,target_values); }
void seesaw_5_factory_init(){ ControllerWeight use_controller; SwitchTerm switch_term; int balancing_requrement =0; int target_tail_angle=0; int gyroOffsetRevise=0; int request_forced_stop; MovementDirection movementDirection = FORWARD; int (*fp_SwitchJudge)(SwitchTerm); //SeesawFinalLineTrace use_controller.target_curvature_controller_weight = 0.0; use_controller.target_light_controller_weight = 1.0; switch_term.distance = 20; switch_term.inclination =0; switch_term.inPushed = 0; switch_term.speed = 0; switch_term.time = 0; balancing_requrement = 1; target_tail_angle=100; gyroOffsetRevise=0; request_forced_stop= 0; movementDirection = FORWARD; fp_SwitchJudge = DistanceSwitch_judge_switch_method; RunningMethod_init(&SeesawFinalLineTraceMethod,balancing_requrement,use_controller,target_tail_angle, gyroOffsetRevise,switch_term,fp_SwitchJudge,request_forced_stop,movementDirection); seesaw_5_running_method_array[0]=SeesawFinalLineTraceMethod; seesaw_5.current_running_method_number = 0; seesaw_5.number_of_running_method = 1; seesaw_5.running_methods = seesaw_5_running_method_array; seesaw_5.target_values.target_brightness = 0.5; seesaw_5.target_values.target_curvature = 0; seesaw_5.target_values.target_speed = 50; seesaw_5.nextSection = &firstCurve; int number_of_running_method=1; TargetValues target_values; target_values.target_brightness = 0.5; target_values.target_curvature = 0.0; target_values.target_speed = 50; Section *nextSection = &firstCurve; RunningMethod *runningMethod = seesaw_5_running_method_array; Section_init(&seesaw_5,nextSection,number_of_running_method,runningMethod,target_values); }
void forth_straight_factory_init() { //Section Local variables TargetValues target_values; Section *nextSection; RunningMethod *runningMethod; //RunningMethod Local Variables ControllerWeight use_controller; SwitchTerm switch_term={0,0,0,0,0}; int number_of_running_method=0; int balancing_requrement =1; int target_tail_angle=0; int gyroOffsetRevise=0; int request_forced_stop = 0; int (*fp_SwitchJudge)(SwitchTerm); MovementDirection movementDirection = FORWARD; //forthStraightLineTraceMethod use_controller.target_curvature_controller_weight = 0.5; use_controller.target_light_controller_weight = 0.5; //switch_term.distance = 1600; //switch_term.distance = 870; switch_term.distance = 1000; balancing_requrement = 1; target_tail_angle=0; gyroOffsetRevise=0; request_forced_stop = 0; movementDirection = FORWARD; fp_SwitchJudge = DistanceSwitch_judge_switch_method; RunningMethod_init(&forthStraightLineTraceMethod,balancing_requrement,use_controller,target_tail_angle, gyroOffsetRevise,switch_term,fp_SwitchJudge,request_forced_stop,movementDirection); //forthStraightLineTraceMethod forth_straight_running_method_array[0]=forthStraightLineTraceMethod; runningMethod = forth_straight_running_method_array; number_of_running_method=1; target_values.target_brightness = 0.5; target_values.target_curvature = 0; target_values.target_speed = 400; nextSection = &forthCurve_1; Section_init(&forthStraight,nextSection,number_of_running_method,runningMethod,target_values); }
void garage_factory_init(){ ControllerWeight use_controller; SwitchTerm switch_term; int balancing_requrement =0; int target_tail_angle=0; int gyroOffsetRevise=0; int request_forced_stop = 0; MovementDirection movementDirection = FORWARD; int (*fp_SwitchJudge)(SwitchTerm); //beforelookupMethod use_controller.target_curvature_controller_weight = 0.0; use_controller.target_light_controller_weight = 0.1; use_controller.target_runner_angle_controller_weight = 0.9; switch_term.distance = 1710; switch_term.inclination = 0; switch_term.inPushed = 0; switch_term.speed = 0; switch_term.time =0; switch_term.distance_obstacle = 0; balancing_requrement = 0; target_tail_angle=80; gyroOffsetRevise=0; request_forced_stop =0; movementDirection = FORWARD; fp_SwitchJudge = DistanceSwitch_judge_switch_method; RunningMethod_init(&beforeGarageMethod,balancing_requrement,use_controller,target_tail_angle, gyroOffsetRevise,switch_term,fp_SwitchJudge,request_forced_stop,movementDirection); garage_running_method_array[0] = beforeGarageMethod; //garage_running_method_array[1] = grayGarageMethod; int number_of_running_method=1; TargetValues target_values; target_values.target_brightness = 0.4; target_values.target_curvature = 0.0; target_values.target_speed = 150; Section *nextSection = &stop; Section_init(&garageIn,nextSection,number_of_running_method,garage_running_method_array,target_values); }
void balancing_init(){ ControllerWeight use_controller; SwitchTerm switch_term; int balancing_requrement =0; int target_tail_angle=0; int gyroOffsetRevise=0; int request_forced_stop=0; MovementDirection movementDirection = FORWARD; int (*fp_SwitchJudge)(SwitchTerm); //beforelookupMethod use_controller.target_curvature_controller_weight = 0.0; use_controller.target_light_controller_weight = 1.0; switch_term.distance = 0; switch_term.inclination = 0; switch_term.inPushed = 0; switch_term.speed = 0; switch_term.time =0; switch_term.distance_obstacle = 40; balancing_requrement = 1; target_tail_angle=80; gyroOffsetRevise=0; request_forced_stop =0; movementDirection = FORWARD; RunningMethod_init(&balancingMethod,balancing_requrement,use_controller,target_tail_angle, gyroOffsetRevise,switch_term,SonarSwitch_judge_switch_method,request_forced_stop,movementDirection); balanceing_method_array[0] = balancingMethod; int number_of_running_method=1; TargetValues target_values; target_values.target_brightness = 0.5; target_values.target_curvature = 0.0; target_values.target_speed = 100; Section *nextSection = &balanceStop; Section_init(&balancing,nextSection,number_of_running_method,balanceing_method_array,target_values); }
void forth_curve_factory_init(){ //Section Local variables TargetValues target_values; Section *nextSection; //RunningMethod Local Variables ControllerWeight use_controller; SwitchTerm switch_term={0,0,0,0,0}; int number_of_running_method=0; int balancing_requrement =1; int target_tail_angle=0; int gyroOffsetRevise=0; int request_forced_stop = 0; int (*fp_SwitchJudge)(SwitchTerm); MovementDirection movementDirection = FORWARD; //forthCurve_1_LineTraceRunningMethod use_controller.target_curvature_controller_weight = 0.4; use_controller.target_light_controller_weight = 0.6; switch_term.distance =308;//458 balancing_requrement = 1; target_tail_angle=0; gyroOffsetRevise=0; request_forced_stop = 0; movementDirection = FORWARD; fp_SwitchJudge = DistanceSwitch_judge_switch_method; RunningMethod_init(&forthCurve_1_LineTraceRunningMethod,balancing_requrement,use_controller,target_tail_angle, gyroOffsetRevise,switch_term,fp_SwitchJudge,request_forced_stop,movementDirection); //forthCurve_1 Section forth_curve_1_running_method_array[0]=forthCurve_1_LineTraceRunningMethod; number_of_running_method=1; target_values.target_brightness = 0.5; target_values.target_curvature = -1.0/1003.09; target_values.target_speed = 300; nextSection= &forthCurve_2; Section_init(&forthCurve_1,nextSection,number_of_running_method,forth_curve_1_running_method_array,target_values); //forthCurve_2_LineTraceRunningMethod use_controller.target_curvature_controller_weight = 0.4; use_controller.target_light_controller_weight = 0.6; switch_term.distance = 682; balancing_requrement = 1; target_tail_angle=0; gyroOffsetRevise=0; request_forced_stop = 0; movementDirection = FORWARD; fp_SwitchJudge = DistanceSwitch_judge_switch_method; RunningMethod_init(&forthCurve_2_LineTraceRunningMethod,balancing_requrement,use_controller,target_tail_angle, gyroOffsetRevise,switch_term,fp_SwitchJudge,request_forced_stop,movementDirection); //forthCurve_2 Section forth_curve_2_running_method_array[0]=forthCurve_2_LineTraceRunningMethod; number_of_running_method=1; target_values.target_brightness = 0.3; target_values.target_curvature = -1/300;//-1/136.09; target_values.target_speed = 250; nextSection = &InFifthStraight; Section_init(&forthCurve_2,nextSection,number_of_running_method,forth_curve_2_running_method_array,target_values); }
void thurd_curve_factory_init() { //Section Local variables TargetValues target_values; Section *nextSection; RunningMethod *runningMethod; //RunningMethod Local Variables ControllerWeight use_controller; SwitchTerm switch_term={0,0,0,0,0,0}; int number_of_running_method=0; int balancing_requrement =1; int target_tail_angle=0; int gyroOffsetRevise=0; int request_forced_stop = 0; int (*fp_SwitchJudge)(SwitchTerm); MovementDirection movementDirection = FORWARD; //thurdCurve_1 RunningMethod use_controller.target_curvature_controller_weight = 0.5; use_controller.target_light_controller_weight = 0.5; switch_term.distance = 187; balancing_requrement = 1; target_tail_angle=0; gyroOffsetRevise=0; request_forced_stop = 0; movementDirection = FORWARD; fp_SwitchJudge = DistanceSwitch_judge_switch_method; RunningMethod_init(&thurdCurve_1LineTraceMethod,balancing_requrement,use_controller,target_tail_angle, gyroOffsetRevise,switch_term,fp_SwitchJudge,request_forced_stop,movementDirection); //thurdCurve_1 Section thurdCurve_1_running_method_array[0]=thurdCurve_1LineTraceMethod; runningMethod = thurdCurve_1_running_method_array; number_of_running_method=1; target_values.target_brightness = 0.5; target_values.target_curvature = 1.0/1678.0; target_values.target_speed = 400; nextSection = &thurdCurve_2; Section_init(&thurdCurve_1,nextSection,number_of_running_method,runningMethod,target_values); //thurdCurve_2 RunningMethod use_controller.target_curvature_controller_weight = 0.4; use_controller.target_light_controller_weight = 0.6; //switch_term.distance = 548.5929; switch_term.distance = 648.5929; balancing_requrement = 1; target_tail_angle=0; gyroOffsetRevise=0; request_forced_stop = 0; movementDirection = FORWARD; fp_SwitchJudge = DistanceSwitch_judge_switch_method; RunningMethod_init(&thurdCurve_2LineTraceMethod,balancing_requrement,use_controller,target_tail_angle, gyroOffsetRevise,switch_term,fp_SwitchJudge,request_forced_stop,movementDirection); //thurdCurve_2 Section thurdCurve_2_running_method_array[0]=thurdCurve_2LineTraceMethod; runningMethod = thurdCurve_2_running_method_array; number_of_running_method=1; target_values.target_brightness = 0.5; //target_values.target_curvature = 1.0/810.0; target_values.target_curvature = 1.0/610.0; target_values.target_speed = 400; nextSection = &thurdCurve_3; Section_init(&thurdCurve_2,nextSection,number_of_running_method,runningMethod,target_values); //thurdCurve_3 RunningMethod use_controller.target_curvature_controller_weight = 0.4; use_controller.target_light_controller_weight = 0.6; switch_term.distance = 1214.5; balancing_requrement = 1; target_tail_angle=0; gyroOffsetRevise=0; request_forced_stop = 0; movementDirection = FORWARD; fp_SwitchJudge = DistanceSwitch_judge_switch_method; RunningMethod_init(&thurdCurve_3LineTraceMethod,balancing_requrement,use_controller,target_tail_angle, gyroOffsetRevise,switch_term,fp_SwitchJudge,request_forced_stop,movementDirection); //thurdCurve_3 Section thurdCurve_3_running_method_array[0]=thurdCurve_3LineTraceMethod; runningMethod = thurdCurve_3_running_method_array; number_of_running_method=1; target_values.target_brightness = 0.5; //target_values.target_curvature = 1.0/978.1; target_values.target_curvature = 1.0/878.1; target_values.target_speed = 400; nextSection = &thurdCurve_4; Section_init(&thurdCurve_3,nextSection,number_of_running_method,runningMethod,target_values); //thurdCurve_4 RunningMethod use_controller.target_curvature_controller_weight = 0.4; use_controller.target_light_controller_weight = 0.6; switch_term.distance = 247; balancing_requrement = 1; target_tail_angle=0; gyroOffsetRevise=0; request_forced_stop = 0; movementDirection = FORWARD; fp_SwitchJudge = DistanceSwitch_judge_switch_method; RunningMethod_init(&thurdCurve_4LineTraceMethod,balancing_requrement,use_controller,target_tail_angle, gyroOffsetRevise,switch_term,fp_SwitchJudge,request_forced_stop,movementDirection); //thurdCurve_4 Section thurdCurve_4_running_method_array[0]=thurdCurve_4LineTraceMethod; runningMethod = thurdCurve_4_running_method_array; number_of_running_method=1; target_values.target_brightness = 0.5; target_values.target_curvature = 1.0/1214.0; target_values.target_speed = 400; nextSection = &thurdCurve_5; Section_init(&thurdCurve_4,nextSection,number_of_running_method,runningMethod,target_values); //thurdCurve_5 RunningMethod use_controller.target_curvature_controller_weight = 0.4; use_controller.target_light_controller_weight = 0.6; switch_term.distance = 400; balancing_requrement = 1; target_tail_angle=0; gyroOffsetRevise=0; request_forced_stop = 0; movementDirection = FORWARD; fp_SwitchJudge = DistanceSwitch_judge_switch_method; RunningMethod_init(&thurdCurve_5LineTraceMethod,balancing_requrement,use_controller,target_tail_angle, gyroOffsetRevise,switch_term,fp_SwitchJudge,request_forced_stop,movementDirection); //thurdCurve_5 Section thurdCurve_5_running_method_array[0]=thurdCurve_5LineTraceMethod; runningMethod = thurdCurve_5_running_method_array; number_of_running_method=1; target_values.target_brightness = 0.5; target_values.target_curvature = 1.0/1000.0; target_values.target_speed = 400; nextSection = &forthStraight; Section_init(&thurdCurve_5,nextSection,number_of_running_method,runningMethod,target_values); }
void In_sixth_curve_factory_init() { //Section Local variables TargetValues target_values; Section *nextSection; //RunningMethod Local Variables ControllerWeight use_controller; SwitchTerm switch_term= {0,0,0,0,0}; int number_of_running_method=0; int balancing_requrement =1; int target_tail_angle=0; int gyroOffsetRevise=0; int request_forced_stop = 0; int (*fp_SwitchJudge)(SwitchTerm); MovementDirection movementDirection = FORWARD; //InFifthCurve_1_LineTraceRunningMethod use_controller.target_curvature_controller_weight = 0.3; use_controller.target_light_controller_weight = 0.7; //switch_term.distance = 463; switch_term.distance = 563; balancing_requrement = 1; target_tail_angle=0; gyroOffsetRevise=0; request_forced_stop = 0; movementDirection = FORWARD; fp_SwitchJudge = DistanceSwitch_judge_switch_method; RunningMethod_init(&InFifth_Curve_1_LineTraceRunningMethod,balancing_requrement,use_controller,target_tail_angle, gyroOffsetRevise,switch_term,fp_SwitchJudge,request_forced_stop,movementDirection); //InFifthCurve_1 Section InFifth_curve_1_running_method_array[0]=InFifth_Curve_1_LineTraceRunningMethod; number_of_running_method=1; target_values.target_brightness = 0.3; //target_values.target_curvature = -1/262.979; target_values.target_curvature = -1/180.0; target_values.target_speed = 250; nextSection= &InFifthCurve_2; Section_init(&InFifthCurve_1,nextSection,number_of_running_method,InFifth_curve_1_running_method_array,target_values); //InFIfthCurve_2_LineTraceRunningMethod use_controller.target_curvature_controller_weight = 0.3; use_controller.target_light_controller_weight = 0.7; switch_term.distance = 492; balancing_requrement = 1; target_tail_angle=0; gyroOffsetRevise=0; request_forced_stop = 0; movementDirection = FORWARD; fp_SwitchJudge = DistanceSwitch_judge_switch_method; RunningMethod_init(&InFifth_Curve_2_LineTraceRunningMethod,balancing_requrement,use_controller,target_tail_angle, gyroOffsetRevise,switch_term,fp_SwitchJudge,request_forced_stop,movementDirection); //InFifthCurve_2 Section InFifth_curve_2_running_method_array[0]=InFifth_Curve_2_LineTraceRunningMethod; number_of_running_method=1; target_values.target_brightness = 0.5; //target_values.target_curvature = 1.0/250.0; target_values.target_curvature = -1.0/859.61; target_values.target_speed = 300; nextSection = &afterInFifthCurveStraight; Section_init(&InFifthCurve_2,nextSection,number_of_running_method,InFifth_curve_2_running_method_array,target_values); }
void forth_curve_factory_init(){ //Section Local variables TargetValues target_values; Section *nextSection; //RunningMethod Local Variables ControllerWeight use_controller; SwitchTerm switch_term={0,0,0,0,0}; int number_of_running_method=0; int balancing_requrement =1; int target_tail_angle=0; int gyroOffsetRevise=0; int request_forced_stop = 0; int (*fp_SwitchJudge)(SwitchTerm); MovementDirection movementDirection = FORWARD; //forthCurve_1_LineTraceRunningMethod use_controller.target_curvature_controller_weight = 0.5; use_controller.target_light_controller_weight = 0.5; switch_term.distance =461.0737; balancing_requrement = 1; target_tail_angle=0; gyroOffsetRevise=0; request_forced_stop = 0; movementDirection = FORWARD; fp_SwitchJudge = DistanceSwitch_judge_switch_method; RunningMethod_init(&forthCurve_1_LineTraceRunningMethod,balancing_requrement,use_controller,target_tail_angle, gyroOffsetRevise,switch_term,fp_SwitchJudge,request_forced_stop,movementDirection); //forthCurve_1 Section forth_curve_1_running_method_array[0]=forthCurve_1_LineTraceRunningMethod; number_of_running_method=1; target_values.target_brightness = 0.5; target_values.target_curvature = -1.0/700.0; target_values.target_speed = 400; nextSection= &forthCurve_2; Section_init(&forthCurve_1,nextSection,number_of_running_method,forth_curve_1_running_method_array,target_values); //forthCurve_2_LineTraceRunningMethod use_controller.target_curvature_controller_weight = 0.5; use_controller.target_light_controller_weight = 0.5; //switch_term.distance = 750.2846; switch_term.distance =900.2846; balancing_requrement = 1; target_tail_angle=0; switch_term.direction = 180; gyroOffsetRevise=0; request_forced_stop = 0; movementDirection = FORWARD; fp_SwitchJudge = DistanceSwitch_judge_switch_method; //fp_SwitchJudge = DirectionDistanceMultipleSwitch_judge_switch_method; RunningMethod_init(&forthCurve_2_LineTraceRunningMethod,balancing_requrement,use_controller,target_tail_angle, gyroOffsetRevise,switch_term,fp_SwitchJudge,request_forced_stop,movementDirection); //forthCurve_2 Section forth_curve_2_running_method_array[0]=forthCurve_2_LineTraceRunningMethod; number_of_running_method=1; target_values.target_brightness = 0.3; //target_values.target_curvature = -1.0/650.0; target_values.target_curvature = -1.0/550.0; target_values.target_speed = 400; nextSection = &outFifthStraight; Section_init(&forthCurve_2,nextSection,number_of_running_method,forth_curve_2_running_method_array,target_values); }
void second_curve_factory_init(){ //Section Local variables TargetValues target_values; Section *nextSection; //RunningMethod Local Variables ControllerWeight use_controller; SwitchTerm switch_term; int number_of_running_method=0; int balancing_requrement =1; int target_tail_angle=0; int gyroOffsetRevise=0; int request_forced_stop = 0; int (*fp_SwitchJudge)(SwitchTerm); MovementDirection movementDirection = FORWARD; //secondCurve_1_LineTraceRunningMethod use_controller.target_curvature_controller_weight = 0.3;//0.4 use_controller.target_light_controller_weight = 0.7;//0.6 //switch_term.distance = 761.83622; switch_term.distance = 601.83622; //sisou switch_term.inclination = 0; switch_term.inPushed = 0; switch_term.speed = 0; switch_term.time =0; balancing_requrement = 1; target_tail_angle=0; gyroOffsetRevise=0; request_forced_stop = 0; movementDirection = FORWARD; fp_SwitchJudge = DistanceSwitch_judge_switch_method; RunningMethod_init(&secondCurve_1_LineTraceRunningMethod,balancing_requrement,use_controller,target_tail_angle, gyroOffsetRevise,switch_term,fp_SwitchJudge,request_forced_stop,movementDirection); //secondCurve_1 Section second_curve_1_running_method_array[0]=secondCurve_1_LineTraceRunningMethod; number_of_running_method=1; target_values.target_brightness = 0.3; //target_values.target_curvature = -1.0/485; target_values.target_curvature = -1.0/385.0; //sisou target_values.target_speed = 300; nextSection= &secondCurve_2; Section_init(&secondCurve_1,nextSection,number_of_running_method,second_curve_1_running_method_array,target_values); //secondCurve_2_LineTraceRunningMethod use_controller.target_curvature_controller_weight = 0.3; use_controller.target_light_controller_weight = 0.7; switch_term.distance = 447.97191; switch_term.distance = 747.97191; switch_term.inclination = 0; switch_term.inPushed = 0; switch_term.speed = 0; switch_term.time =0; balancing_requrement = 1; target_tail_angle=0; gyroOffsetRevise=0; request_forced_stop = 0; movementDirection = FORWARD; fp_SwitchJudge = DistanceSwitch_judge_switch_method; RunningMethod_init(&secondCurve_2_LineTraceRunningMethod,balancing_requrement,use_controller,target_tail_angle, gyroOffsetRevise,switch_term,fp_SwitchJudge,request_forced_stop,movementDirection); //secondCurve_2 Section second_curve_2_running_method_array[0]=secondCurve_2_LineTraceRunningMethod; number_of_running_method=1; target_values.target_brightness = 0.3; //target_values.target_curvature = -1.0/370; target_values.target_curvature = -1.0/200; target_values.target_speed = 300; nextSection = &secondCurve_3; Section_init(&secondCurve_2,nextSection,number_of_running_method,second_curve_2_running_method_array,target_values); //secondCurve_3_LineTraceRunningMethod use_controller.target_curvature_controller_weight = 0.4; use_controller.target_light_controller_weight = 0.6; switch_term.distance = 349.32571; switch_term.inclination = 0; switch_term.inPushed = 0; switch_term.speed = 0; switch_term.time =0; balancing_requrement = 1; target_tail_angle=0; gyroOffsetRevise=0; request_forced_stop =0 ; movementDirection = FORWARD; fp_SwitchJudge = DistanceSwitch_judge_switch_method; RunningMethod_init(&secondCurve_3_LineTraceRunningMethod,balancing_requrement,use_controller,target_tail_angle, gyroOffsetRevise,switch_term,fp_SwitchJudge,request_forced_stop,movementDirection); //secondCurve_3 Section second_curve_3_running_method_array[0]=secondCurve_3_LineTraceRunningMethod; number_of_running_method=1; target_values.target_brightness = 0.3; target_values.target_curvature = -1.0/230; target_values.target_speed = 300; nextSection = &thurdStraight; Section_init(&secondCurve_3,nextSection,number_of_running_method,second_curve_3_running_method_array,target_values); }