ArduPilot开源飞控之AP_Mission
ArduPilot开源飞控之AP_Mission
- 1. 源由
- 2. AP_Mission类
- 3 简令结构
- 3.1 导航相关
- 3.1.1 jump command
- 3.1.2 condition delay command
- 3.1.3 condition distance command
- 3.1.4 condition yaw command
- 3.1.5 change speed command
- 3.1.6 nav guided command
- 3.1.7 do VTOL transition
- 3.1.8 navigation delay command
- 3.1.9 DO_ENGINE_CONTROL support
- 3.1.10 NAV_SET_YAW_SPEED support
- 3.1.11 high altitude balloon altitude wait
- 3.2 外围设备
- 3.2.1 继电器操作
- 3.2.2 伺服器操作
- 3.3.3 云台角度
- 3.3.4 摄像头操作
- 3.3.5 夹具操作
- 3.3.6 辅助开关
- 3.3.7 绞车命令
- 3.4 脚本命令
- 3.4.1 scripting command
- 3.4.2 scripting NAV command
- 3.4.3 Scripting NAV command (with verify)
- 3.5 MAVLink命令
- 3.5.1 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW support
- 3.5.2 MAV_CMD_IMAGE_START_CAPTURE support
- 3.5.3 MAV_CMD_SET_CAMERA_ZOOM support
- 3.5.4 MAV_CMD_SET_CAMERA_FOCUS support
- 3.5.5 MAV_CMD_VIDEO_START_CAPTURE support
- 3.5.6 MAV_CMD_VIDEO_STOP_CAPTURE support
- 4. 方法
- 4.1 init
- 4.2 state
- 4.3 num_commands
- 4.4 num_commands_max
- 4.5 start
- 4.6 stop
- 4.7 resume
- 4.8 start_or_resume
- 4.9 starts_with_takeoff_cmd
- 4.10 reset
- 4.11 clear
- 4.12 truncate
- 4.13 update
- 4.14 add_cmd
- 4.15 replace_cmd
- 4.16 is_nav_cmd
- 4.17 get_current_nav_cmd
- 4.18 get_current_nav_index
- 4.19 get_current_nav_id
- 4.20 get_prev_nav_cmd_id
- 4.21 get_prev_nav_cmd_index
- 4.22 get_prev_nav_cmd_with_wp_index
- 4.23 get_next_nav_cmd
- 4.24 get_next_ground_course_cd
- 4.25 get_current_do_cmd
- 4.26 get_current_do_cmd_id
- 4.27 set_current_cmd
- 4.28 restart_current_nav_cmd
- 4.29 read_cmd_from_storage
- 4.30 write_cmd_to_storage
- 4.31 write_home_to_storage
- 4.32 last_change_time_ms
- 4.33 get_landing_sequence_start
- 4.34 jump_to_landing_sequence
- 4.35 jump_to_abort_landing_sequence
- 4.36 is_best_land_sequence
- 4.37 set_in_landing_sequence_flag
- 4.38 get_in_landing_sequence_flag
- 4.39 set_force_resume
- 4.40 get_semaphore
- 4.41 contains_item
- 4.42 contains_terrain_alt_items
- 4.43 cmd_has_location
- 4.44 reset_wp_history
- 4.45 continue_after_land_check_for_takeoff/continue_after_land
- 4.46 get_item/set_item
- 4.47 get_last_jump_tag
- 4.48 jump_to_tag
- 4.40 get_index_of_jump_tag
- 4.50 failed_sdcard_storage
- 5. 参考资料
1. 源由
ArduPilot中的AP_Mission主要用于处理存储器内部Mission任务相关指令的读/写操作。
- responsible for managing a list of commands made up of “nav”, “do” and “conditional” commands
负责管理任务命令列表:“nav”, “do” , “conditional”
- reads and writes the mission commands to storage.
负责从存储设备中读/写任务命令
- provides easy access to current, previous and upcoming waypoints
负责提供当前/之前/后续航点信息
- calls main program’s command execution and verify functions.
负责执行命令,并验证完成情况
- accounts for the DO_JUMP command
负责DO_JUMP命令
飞控的自主导航任务,通常有三种方式:
- 起飞前,将规划导航任务相关的指令按照顺序存储在飞控内部存储器
- 实际飞行过程中,通过存储获取每一步的操作指令,依次执行命令
- 在遇到异常情况时,根据飞行配置参数执行相关异常规避策略
因此,AP_Mission类的理解对于飞控自主导航任务是重中之重,为此,研读下这部分代码逻辑。
2. AP_Mission类
研读会从四个方面进行展开:
- 类的声明
==》详见:AP_Mission
- 实例初始化/运行过程如下:
Copter::init_ardupilot└──> <MODE_AUTO_ENABLED == ENABLED> mode_auto.mission.init()Copter::update_flight_mode└──> flightmode->run (ModeAuto::run)└──> mission.update()
- 简令结构
==》专门独立章节进行展开
- 方法接口
==》专门独立章节进行展开
3 简令结构
3.1 导航相关
3.1.1 jump command
// jump command structurestruct PACKED Jump_Command {uint16_t target; // target command idint16_t num_times; // num times to repeat. -1 = repeat forever};
3.1.2 condition delay command
// condition delay command structurestruct PACKED Conditional_Delay_Command {float seconds; // period of delay in seconds};
3.1.3 condition distance command
// condition delay command structurestruct PACKED Conditional_Distance_Command {float meters; // distance from next waypoint in meters};
注:代码注释似乎有拼写错误,这里给纠正下。
3.1.4 condition yaw command
// condition yaw command structurestruct PACKED Yaw_Command {float angle_deg; // target angle in degrees (0=north, 90=east)float turn_rate_dps; // turn rate in degrees / second (0=use default)int8_t direction; // -1 = ccw, +1 = cwuint8_t relative_angle; // 0 = absolute angle, 1 = relative angle};
3.1.5 change speed command
// change speed command structurestruct PACKED Change_Speed_Command {uint8_t speed_type; // 0=airspeed, 1=ground speedfloat target_ms; // target speed in m/s, -1 means no changefloat throttle_pct; // throttle as a percentage (i.e. 1 ~ 100), 0 means no change};
3.1.6 nav guided command
// nav guided commandstruct PACKED Guided_Limits_Command {// max time is held in p1 fieldfloat alt_min; // min alt below which the command will be aborted. 0 for no lower alt limitfloat alt_max; // max alt above which the command will be aborted. 0 for no upper alt limitfloat horiz_max; // max horizontal distance the vehicle can move before the command will be aborted. 0 for no horizontal limit};
3.1.7 do VTOL transition
// do VTOL transitionstruct PACKED Do_VTOL_Transition {uint8_t target_state;};
3.1.8 navigation delay command
// navigation delay command structurestruct PACKED Navigation_Delay_Command {float seconds; // period of delay in secondsint8_t hour_utc; // absolute time's hour (utc)int8_t min_utc; // absolute time's min (utc)int8_t sec_utc; // absolute time's sec (utc)};
3.1.9 DO_ENGINE_CONTROL support
// DO_ENGINE_CONTROL supportstruct PACKED Do_Engine_Control {bool start_control; // start or stop enginebool cold_start; // use cold start procedureuint16_t height_delay_cm; // height delay for start};
3.1.10 NAV_SET_YAW_SPEED support
// NAV_SET_YAW_SPEED supportstruct PACKED Set_Yaw_Speed {float angle_deg; // target angle in degrees (0=north, 90=east)float speed; // speed in meters/seconduint8_t relative_angle; // 0 = absolute angle, 1 = relative angle};
3.1.11 high altitude balloon altitude wait
// high altitude balloon altitude waitstruct PACKED Altitude_Wait {float altitude; // metersfloat descent_rate; // m/suint8_t wiggle_time; // seconds};
3.2 外围设备
3.2.1 继电器操作
// set relay command structurestruct PACKED Set_Relay_Command {uint8_t num; // relay number from 1 to 4uint8_t state; // on = 3.3V or 5V (depending upon board), off = 0V. only used for do-set-relay, not for do-repeat-relay};
// repeat relay command structurestruct PACKED Repeat_Relay_Command {uint8_t num; // relay number from 1 to 4int16_t repeat_count; // number of times to trigger the relayfloat cycle_time; // cycle time in seconds (the time between peaks or the time the relay is on and off for each cycle?)};
3.2.2 伺服器操作
// set servo command structurestruct PACKED Set_Servo_Command {uint8_t channel; // servo channeluint16_t pwm; // pwm value for servo};
// repeat servo command structurestruct PACKED Repeat_Servo_Command {uint8_t channel; // servo channeluint16_t pwm; // pwm value for servoint16_t repeat_count; // number of times to move the servo (returns to trim in between)float cycle_time; // cycle time in seconds (the time between peaks or the time the servo is at the specified pwm value for each cycle?)};
3.3.3 云台角度
// mount control command structurestruct PACKED Mount_Control {float pitch; // pitch angle in degreesfloat roll; // roll angle in degreesfloat yaw; // yaw angle (relative to vehicle heading) in degrees};
3.3.4 摄像头操作
// digicam configure command structurestruct PACKED Digicam_Configure {uint8_t shooting_mode; // ProgramAuto = 1, AV = 2, TV = 3, Man=4, IntelligentAuto=5, SuperiorAuto=6uint16_t shutter_speed;uint8_t aperture; // F stop number * 10uint16_t ISO; // 80, 100, 200, etcuint8_t exposure_type;uint8_t cmd_id;float engine_cutoff_time; // seconds};
// digicam control command structurestruct PACKED Digicam_Control {uint8_t session; // 1 = on, 0 = offuint8_t zoom_pos;int8_t zoom_step; // +1 = zoom in, -1 = zoom outuint8_t focus_lock;uint8_t shooting_cmd;uint8_t cmd_id;};
// set cam trigger distance command structurestruct PACKED Cam_Trigg_Distance {float meters; // distanceuint8_t trigger; // triggers one image capture immediately};
3.3.5 夹具操作
// gripper command structurestruct PACKED Gripper_Command {uint8_t num; // gripper numberuint8_t action; // action (0 = release, 1 = grab)};
3.3.6 辅助开关
// AUX_FUNCTION command structurestruct PACKED AuxFunction {uint16_t function; // from RC_Channel::AUX_FUNCuint8_t switchpos; // from RC_Channel::AuxSwitchPos};
3.3.7 绞车命令
// winch command structurestruct PACKED Winch_Command {uint8_t num; // winch numberuint8_t action; // action (0 = relax, 1 = length control, 2 = rate control)float release_length; // cable distance to unwind in meters, negative numbers to wind in cablefloat release_rate; // release rate in meters/second};
3.4 脚本命令
3.4.1 scripting command
// Scripting command structurestruct PACKED scripting_Command {float p1;float p2;float p3;};
3.4.2 scripting NAV command
// Scripting NAV command old version of storage formatstruct PACKED nav_script_time_Command_tag0 {uint8_t command;uint8_t timeout_s;float arg1;float arg2;};// Scripting NAV command, new version of storage formatstruct PACKED nav_script_time_Command {uint8_t command;uint8_t timeout_s;Float16_t arg1;Float16_t arg2;// last 2 arguments need to be integers due to MISSION_ITEM_INT encodingint16_t arg3;int16_t arg4;};
3.4.3 Scripting NAV command (with verify)
// Scripting NAV command (with verify)struct PACKED nav_attitude_time_Command {uint16_t time_sec;int16_t roll_deg;int8_t pitch_deg;int16_t yaw_deg;int16_t climb_rate;};
3.5 MAVLink命令
3.5.1 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW support
// MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW supportstruct PACKED gimbal_manager_pitchyaw_Command {int8_t pitch_angle_deg;int16_t yaw_angle_deg;int8_t pitch_rate_degs;int8_t yaw_rate_degs;uint8_t flags;uint8_t gimbal_id;};
3.5.2 MAV_CMD_IMAGE_START_CAPTURE support
// MAV_CMD_IMAGE_START_CAPTURE supportstruct PACKED image_start_capture_Command {float interval_s;uint16_t total_num_images;uint16_t start_seq_number;};
3.5.3 MAV_CMD_SET_CAMERA_ZOOM support
// MAV_CMD_SET_CAMERA_ZOOM supportstruct PACKED set_camera_zoom_Command {uint8_t zoom_type;float zoom_value;};
3.5.4 MAV_CMD_SET_CAMERA_FOCUS support
// MAV_CMD_SET_CAMERA_FOCUS supportstruct PACKED set_camera_focus_Command {uint8_t focus_type;float focus_value;};
3.5.5 MAV_CMD_VIDEO_START_CAPTURE support
// MAV_CMD_VIDEO_START_CAPTURE supportstruct PACKED video_start_capture_Command {uint8_t video_stream_id;};
3.5.6 MAV_CMD_VIDEO_STOP_CAPTURE support
// MAV_CMD_VIDEO_STOP_CAPTURE supportstruct PACKED video_stop_capture_Command {uint8_t video_stream_id;};
4. 方法
4.1 init
/// init - initialises this library including checks the version in eeprom matches this libraryvoid init();
注:在Copter::init_ardupilot
中被调用。
4.2 state
/// status - returns the status of the mission (i.e. Mission_Started, Mission_Complete, Mission_Stoppedmission_state state() const{return _flags.state;}// mission state enumerationenum mission_state {MISSION_STOPPED=0,MISSION_RUNNING=1,MISSION_COMPLETE=2};
4.3 num_commands
/// num_commands - returns total number of commands in the mission/// this number includes offset 0, the home locationuint16_t num_commands() const{return _cmd_total;}
4.4 num_commands_max
/// num_commands_max - returns maximum number of commands that can be storeduint16_t num_commands_max() const {return _commands_max;}
4.5 start
/// start - resets current commands to point to the beginning of the mission/// To-Do: should we validate the mission first and return true/false?void start();
4.6 stop
/// stop - stops mission execution. subsequent calls to update() will have no effect until the mission is started or resumedvoid stop();
4.7 resume
/// resume - continues the mission execution from where we last left off/// previous running commands will be re-initialisedvoid resume();
4.8 start_or_resume
/// start_or_resume - if MIS_AUTORESTART=0 this will call resume(), otherwise it will call start()void start_or_resume();
4.9 starts_with_takeoff_cmd
/// check mission starts with a takeoff commandbool starts_with_takeoff_cmd();
4.10 reset
/// reset - reset mission to the first commandvoid reset();
4.11 clear
/// clear - clears out missionbool clear();
4.12 truncate
/// truncate - truncate any mission items beyond given indexvoid truncate(uint16_t index);
4.13 update
/// update - ensures the command queues are loaded with the next command and calls main programs command_init and command_verify functions to progress the mission/// should be called at 10hz or highervoid update();
4.14 add_cmd
/// add_cmd - adds a command to the end of the command list and writes to storage/// returns true if successfully added, false on failure/// cmd.index is updated with it's new position in the missionbool add_cmd(Mission_Command& cmd);
4.15 replace_cmd
/// replace_cmd - replaces the command at position 'index' in the command list with the provided cmd/// replacing the current active command will have no effect until the command is restarted/// returns true if successfully replaced, false on failurebool replace_cmd(uint16_t index, const Mission_Command& cmd);
4.16 is_nav_cmd
/// is_nav_cmd - returns true if the command's id is a "navigation" command, false if "do" or "conditional" commandstatic bool is_nav_cmd(const Mission_Command& cmd);
4.17 get_current_nav_cmd
/// get_current_nav_cmd - returns the current "navigation" commandconst Mission_Command& get_current_nav_cmd() const{return _nav_cmd;}
4.18 get_current_nav_index
/// get_current_nav_index - returns the current "navigation" command index/// Note that this will return 0 if there is no command. This is/// used in MAVLink reporting of the mission commanduint16_t get_current_nav_index() const{return _nav_cmd.index==AP_MISSION_CMD_INDEX_NONE?0:_nav_cmd.index;}
4.19 get_current_nav_id
/// get_current_nav_id - return the id of the current nav commanduint16_t get_current_nav_id() const{return _nav_cmd.id;}
4.20 get_prev_nav_cmd_id
/// get_prev_nav_cmd_id - returns the previous "navigation" command id/// if there was no previous nav command it returns AP_MISSION_CMD_ID_NONE/// we do not return the entire command to save on RAMuint16_t get_prev_nav_cmd_id() const{return _prev_nav_cmd_id;}
4.21 get_prev_nav_cmd_index
/// get_prev_nav_cmd_index - returns the previous "navigation" commands index (i.e. position in the mission command list)/// if there was no previous nav command it returns AP_MISSION_CMD_INDEX_NONE/// we do not return the entire command to save on RAMuint16_t get_prev_nav_cmd_index() const{return _prev_nav_cmd_index;}
4.22 get_prev_nav_cmd_with_wp_index
/// get_prev_nav_cmd_with_wp_index - returns the previous "navigation" commands index that contains a waypoint (i.e. position in the mission command list)/// if there was no previous nav command it returns AP_MISSION_CMD_INDEX_NONE/// we do not return the entire command to save on RAMuint16_t get_prev_nav_cmd_with_wp_index() const{return _prev_nav_cmd_wp_index;}
4.23 get_next_nav_cmd
/// get_next_nav_cmd - gets next "navigation" command found at or after start_index/// returns true if found, false if not found (i.e. reached end of mission command list)/// accounts for do_jump commandsbool get_next_nav_cmd(uint16_t start_index, Mission_Command& cmd);
4.24 get_next_ground_course_cd
/// get the ground course of the next navigation leg in centidegrees/// from 0 36000. Return default_angle if next navigation/// leg cannot be determinedint32_t get_next_ground_course_cd(int32_t default_angle);
4.25 get_current_do_cmd
/// get_current_do_cmd - returns active "do" commandconst Mission_Command& get_current_do_cmd() const{return _do_cmd;}
4.26 get_current_do_cmd_id
/// get_current_do_cmd_id - returns id of the active "do" commanduint16_t get_current_do_cmd_id() const{return _do_cmd.id;}
4.27 set_current_cmd
// set_current_cmd - jumps to command specified by indexbool set_current_cmd(uint16_t index, bool rewind = false);
4.28 restart_current_nav_cmd
// restart current navigation command. Used to handle external changes to mission// returns true on success, false if current nav command has been deletedbool restart_current_nav_cmd();
4.29 read_cmd_from_storage
/// load_cmd_from_storage - load command from storage/// true is return if successfulbool read_cmd_from_storage(uint16_t index, Mission_Command& cmd) const;
4.30 write_cmd_to_storage
/// write_cmd_to_storage - write a command to storage/// cmd.index is used to calculate the storage location/// true is returned if successfulbool write_cmd_to_storage(uint16_t index, const Mission_Command& cmd);
4.31 write_home_to_storage
/// write_home_to_storage - writes the special purpose cmd 0 (home) to storage/// home is taken directly from ahrsvoid write_home_to_storage();
4.32 last_change_time_ms
// return the last time the mission changed in millisecondsuint32_t last_change_time_ms(void) const{return _last_change_time_ms;}
4.33 get_landing_sequence_start
// find the nearest landing sequence starting point (DO_LAND_START) and// return its index. Returns 0 if no appropriate DO_LAND_START point can// be found.uint16_t get_landing_sequence_start();
4.34 jump_to_landing_sequence
// find the nearest landing sequence starting point (DO_LAND_START) and// switch to that mission item. Returns false if no DO_LAND_START// available.bool jump_to_landing_sequence(void);
4.35 jump_to_abort_landing_sequence
// jumps the mission to the closest landing abort that is planned, returns false if unable to find a valid abortbool jump_to_abort_landing_sequence(void);
4.36 is_best_land_sequence
// check which is the shortest route to landing an RTL via a DO_LAND_START or continuing on the current mission planbool is_best_land_sequence(void);
4.37 set_in_landing_sequence_flag
// set in_landing_sequence flagvoid set_in_landing_sequence_flag(bool flag){_flags.in_landing_sequence = flag;}
4.38 get_in_landing_sequence_flag
// get in_landing_sequence flagbool get_in_landing_sequence_flag() const {return _flags.in_landing_sequence;}
4.39 set_force_resume
// force mission to resume when start_or_resume() is calledvoid set_force_resume(bool force_resume){_force_resume = force_resume;}
4.40 get_semaphore
// get a reference to the AP_Mission semaphore, allowing an external caller to lock the// storage while working with multiple waypointsHAL_Semaphore &get_semaphore(void){return _rsem;}
4.41 contains_item
// returns true if the mission contains the requested itemsbool contains_item(MAV_CMD command) const;
4.42 contains_terrain_alt_items
// returns true if the mission has a terrain relative mission itembool contains_terrain_alt_items(void);
4.43 cmd_has_location
// returns true if the mission cmd has a locationstatic bool cmd_has_location(const uint16_t command);
4.44 reset_wp_history
// reset the mission history to prevent recalling previous mission histories when restarting missions.void reset_wp_history(void);
4.45 continue_after_land_check_for_takeoff/continue_after_land
/*return true if MIS_OPTIONS is set to allow continue of missionlogic after a land and the next waypoint is a takeoff. If thisis false then after a landing is complete the vehicle should disarm and mission logic should stop*/bool continue_after_land_check_for_takeoff(void);bool continue_after_land(void) const {return (_options.get() & AP_MISSION_MASK_CONTINUE_AFTER_LAND) != 0;}
4.46 get_item/set_item
// allow lua to get/set any WP items in any order in a mavlink-ish kinda way.bool get_item(uint16_t index, mavlink_mission_item_int_t& result) const ;bool set_item(uint16_t index, mavlink_mission_item_int_t& source) ;
4.47 get_last_jump_tag
// Jump Tags. When a JUMP_TAG is run in the mission, either via DO_JUMP_TAG or// by just being the next item, the tag is remembered and the age is set to 1.// Only the most recent tag is remembered. It's age is how many NAV items have// progressed since the tag was seen. While executing the tag, the// age will be 1. The next NAV command after it will tick the age to 2, and so on.bool get_last_jump_tag(uint16_t &tag, uint16_t &age) const;
4.48 jump_to_tag
// Set the mission index to the first JUMP_TAG with this tag.// Returns true on success, else false if no appropriate JUMP_TAG match can be found or if setting the index failedbool jump_to_tag(const uint16_t tag);
4.40 get_index_of_jump_tag
// find the first JUMP_TAG with this tag and return its index.// Returns 0 if no appropriate JUMP_TAG match can be found.uint16_t get_index_of_jump_tag(const uint16_t tag) const;
4.50 failed_sdcard_storage
#if AP_SDCARD_STORAGE_ENABLEDbool failed_sdcard_storage(void) const {return _failed_sdcard_storage;}
#endif
5. 参考资料
【1】ArduPilot开源飞控系统之简单介绍
【2】ArduPilot飞控启动&运行过程简介
【3】ArduPilot之开源代码Library&Sketches设计
相关文章:
ArduPilot开源飞控之AP_Mission
ArduPilot开源飞控之AP_Mission 1. 源由2. AP_Mission类3 简令结构3.1 导航相关3.1.1 jump command3.1.2 condition delay command3.1.3 condition distance command3.1.4 condition yaw command3.1.5 change speed command3.1.6 nav guided command3.1.7 do VTOL transition3.…...
JVM111
JVM1 字节码与多语言混合编程 字节码 我们平时说的java字节码, 指的是用java语言编译成的字节码。准确的说任何能在jvm平台上执行的字节码格式都是一样的。所以应该统称为:jvm字节码。不同的编译器,可以编译出相同的字节码文件,字节码文件…...
排序篇(三)----交换排序
排序篇(三)----交换排序 1.冒泡排序 基本思想: 通过不断地比较相邻的元素,将较大的元素往后移动,从而实现排序的目的。 具体的步骤如下: 从待排序的数组中选择相邻的两个元素进行比较,如果前一个元素大于后一个元素&#…...
React antd Table点击下一页后selectedRows丢失之前页选择内容的问题
一、问题 使用了React antd 的<Table>标签,是这样记录选中的行id与行内容的: <TabledataSource{data.list}rowSelection{{selectedRowKeys: selectedIdsInSearchTab,onChange: this.onSelectChange,}} // 表格是否可复选,加 type: …...
蓝牙核心规范(V5.4)11.4-LE Audio 笔记之音频模型
专栏汇总网址:蓝牙篇之蓝牙核心规范学习笔记(V5.4)汇总_蓝牙核心规范中文版_心跳包的博客-CSDN博客 爬虫网站无德,任何非CSDN看到的这篇文章都是盗版网站,你也看不全。认准原始网址。!!! 从一开始,蓝牙低功耗(Bluetooth Low Energy,BLE)音频的开发就秉持着“以设…...
Spring Boot:利用JPA进行数据库的查删
目录标题 DAO 、Service 、 Controller 层控制器文件示例代码-单个查找查找成功示例代码-列表查找查找成功示例代码-删除删除成功 DAO 、Service 、 Controller 层 DAO 层负责数据库访问,它封装了对数据库的访问操作,例如查询、插入、更新和删除等。 Q…...
1711: 【穷举】满足条件的整数
题目描述 假设a、b、c均为整数(1<a,b,c<100),同时a<b,找出所有符合条件:a2 b2 n*c3的整数组。 按a从小到大的顺序输出所有满足条件的整数组(若a相同,则按b从小到大的顺序输出) 输入…...
【数据结构】堆的应用-----TopK问题
目录 一、前言 二、Top-k问题 💦解法一:暴力排序 💦解法二:建立N个数的堆 💦解法三:建立K个数的堆(最优解) 三、完整代码和视图 四、共勉 一、前言 在之前的文章中ÿ…...
QT之xml文件的读写
QT之xml文件的读写 简介用法举例 简介 QT的QDomDocument、QDomElement、QDomNode是Qt XML模块中的三个类,用于解析和操作XML文档。 1)QDomDocument类: QDomDocument类表示整个XML文档。它提供了解析XML文档的方法,如setContent(…...
C语言中的异常处理机制是什么?
C语言中的异常处理机制 C语言是一门强大而灵活的编程语言,它为程序员提供了广泛的控制权和自由度。然而,C语言本身并不提供像其他高级语言一样的内置异常处理机制,如Java中的try-catch或Python中的异常处理。因此,C语言程序员需要…...
Java中的并发编程模型和常用工具类
本文主要介绍了Java中的并发编程模型和常用工具类,首先阐述了并发编程的概念及其重要性,然后详细介绍了线程的基本概念、生命周期和状态转换、同步与互斥、死锁问题以及线程池的使用和实现原理。接着介绍了synchronized关键字和Lock接口的使用、原子变量…...
第10章 MySQL(一)
10.1 谈谈MySQL的架构 难度:★★ 重点:★ 白话解析 要想彻底的理解MySQL,它的架构一定要先弄清楚,当Java程序员通过JDBC或者Mybatis去执行一条SQL的时候,到底经历了什么。下边先看一幅图: 户端:Java程序员通过JDBC或者Mybatis去拿MySQL的驱动程序,实际上就是拿客户端。…...
英飞凌 Tricore 架构中断系统详解
本文以TC3系列MCU为例,先来了解中断源是如何产生的,再看一下CPU是如何处理中断源的。 AURIX TC3XX的中断路由模块 Interrupt Router (IR) 在TC3中,中断既可以被CPU处理,也可以被DMA处理,所以手册中不再把中断称为中断…...
单例模式:饿汉式
单例模式全局仅一个实例,用于获取公共的内容 头文件mglobalinfomgr.h class MGlobalInfoMgr {MGlobalInfoMgr();~MGlobalInfoMgr(); public:static MGlobalInfoMgr* GetInstance(); private:static MGlobalInfoMgr* _instance; }; 源文件mglobalinfomgr.cpp MGl…...
什么是视图
目录 一、什么是视图 二、视图的作用 三、创建视图 四、使用视图 1.使用视图查询员工信息 五、注意事项 六、补充 一、什么是视图 视图是基于查询的虚拟表,是一个逻辑表,本身并不包含数据。同真实的表一样,视图包含一系列带有名称的列…...
C++——list(2)
作者:几冬雪来 时间:2023年9月28日 内容:C——list内容讲解 目录 前言: list的const迭代器: const的iterator: const迭代器: operator->: 拷贝构造: 迭代器接口补充&…...
Django基础讲解-路由控制器和视图(Django-02)
一 路由控制器 参考链接: Django源码阅读:路由(二) - 知乎 Route路由, 是一种映射关系!路由是把客户端请求的 url路径与视图进行绑定 映射的一种关系。 这个/timer通过路由控制器最终匹配到myapp.views中的视图函数 …...
【算法题】2873. 有序三元组中的最大值 I
题目: 给你一个下标从 0 开始的整数数组 nums 。 请你从所有满足 i < j < k 的下标三元组 (i, j, k) 中,找出并返回下标三元组的最大值。如果所有满足条件的三元组的值都是负数,则返回 0 。 下标三元组 (i, j, k) 的值等于 (nums[i]…...
HTML5 跨屏前端框架 Amaze UI
Amaze UI采用国际最前沿的“组件式开发”以及“移动优先”的设计理念,基于其丰富的组件,开发者可通过简单拼装即可快速构建出HTML5网页应用,上线仅半年,Amaze UI就成为了国内最流行的前端框架,目前在Github上收获Star数…...
EXCEL会计记账报表财务软件企业公司做账系统凭证自动生成报表
本系统基于VBA编程设计,具有界面简洁美观,操作方便快捷,功能完备实用的特点,系统分为基本信息、凭证处理、账簿查询、会计报表、固定资产管理、系统管理、凭证数据库七大模块,您只需要录入记账凭证,就可以自…...
Can‘t pickle <class ‘__main__.Test‘>: it‘s not the same object as __main__.Test
目录 原因1 类名重复了 案例1 变量名和类名重复 原因1 类名重复了 检查项目代码,是不是其他地方有同名类。 案例1 变量名和类名重复 转自:python3报错Cant pickle <class __main__.Test>: its not the same object as __main__.Test解决 - 知乎…...
第九章 动态规划 part14 1143. 最长公共子序列 1035. 不相交的线 53. 最大子序和
第五十六天| 第九章 动态规划 part14 1143. 最长公共子序列 1035. 不相交的线 53. 最大子序和 一、1143. 最长公共子序列 题目链接: 题目介绍: 思路: 本题和“最长重复子数组”区别在于**这里不要求是连续的了,但要有相对顺序*…...
腾讯云服务器南京地域详细介绍、测试IP和Ping值测速
腾讯云服务器南京地域怎么样?南京地域很不错,正好处于中间的位置,南方北方用户均可以选择,网络延迟更低速度更快,并且目前南京地域有活动,南京地域可用区可选南京一区、南京二区和南京三区,腾讯…...
理解CSS的层叠性和继承性
CSS的层叠性(cascading)指的是在同一元素上应用多个样式时,不同样式之间的优先级别以及如何进行组合和冲突解决的规则。具体来说,CSS采用的是“选择器优先级”规则来判断哪个样式优先级更高,如果多个样式的优先级相同&…...
OSI体系结构和TCP/IP体系结构
在第一章( 计网第一章 )的时候,曾经提到过OSI体系结构和TCP/IP体系结构,并对它们进行了简单的对比。这篇博客在其基础上进行更深层次的理解。 一.OSI体系结构: 通信子网: 计算机网络在逻辑功能上可以分为…...
侯捷 C++ STL标准库和泛型编程 —— 8 适配器
8 适配器 适配器 Adapter 只是一个小变化,比如改个接口,函数名称等等其出现在三个地方:仿函数适配器,迭代器适配器,容器适配器可以使用继承 / 复合的两种方式实现,STL中都用复合 其思想就是将该记的东西记…...
每日一题 416 分割等和子集(01背包)
题目 分割等和子集 给你一个 只包含正整数 的 非空 数组 nums 。请你判断是否可以将这个数组分割成两个子集,使得两个子集的元素和相等。 示例 1: 输入:nums [1,5,11,5] 输出:true 解释:数组可以分割成 [1, 5, 5] …...
U盘插上就显示让格式化是坏了吗?
U盘以其体积小巧、存储容量大、读写速度快的特点,在各种工作和个人使用场合中得到了广泛应用,因此深得用户好评。然而,在日常使用U盘的过程中,经常会遇到一些问题和挑战。今天,我将为大家详细解释U盘出现要求格式化的现…...
分布式应用程序协调服务 ZooKeeper 详解
目录 1、ZooKeeper简介 2、ZooKeeper的使用场景 3、ZooKeeper设计目的 4、ZooKeeper数据模型 5、ZooKeeper几个重要概念 5.1、ZooKeeper Session 5.2、ZooKeeper Watch 5.3、Consistency Guarantees 6、ZooKeeper的工作原理 6.1、Leader Election 6.2、Leader工作流…...
Anniversary party(树形dp 基础题)
1.题目大意 There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees. It means that the supervisor relation forms a tree rooted at the rector V. E. Tretyakov. In …...
学做ppt的网站有哪些内容/seo推广系统
hive空字符串数组和空数组 最近在处理数据时发现一个有意思的情况 空字符串数组 :array(’’) 空数组:array() select size(array()), size(array()); 将字符串数组转换为字符串: concat_ws(,,collect_set(cast(colum))) 如果想查找表中…...
wordpress如何设置301/武汉企业seo推广
模板介绍 精美PPT模板设计,淡雅个人简历自我介绍PPT模板。一套个人简历幻灯片模板,内含蓝色多种配色,精美风格设计,动态播放效果,精美实用。 一份设计精美的PPT模板,可以让你在汇报演讲时脱颖而出。 希望…...
网站关键词更换了/百度小说排行
夏天里适当做一些运动,非常有助于健康。运动过程中音乐的陪伴会让你充满动力。小米蓝牙耳机Line Free搭载全新的Qualcomm QCC5125蓝牙音频芯片,支持Qualcomm aptX™ Adaptive音频技术,带来更高质量的蓝牙音频体验。细腻触感 佩戴舒适小米Line…...
wordpress 地址插件/seopeixun
1、为什么使用em em也是css中的一种单位,和px类似。很多人会疑惑为什么有了px之后还要使用em,而且em使用起来相对于px来讲比较麻烦。 em主要是应用于弹性布局,下面给出一个小栗子说明em的强大之处 <!DOCTYPE html> <html lang"…...
网站建设遵循原则/windows优化大师卸载不掉
近期使用Spark开发ML机器学习模型的时候,其中有一个部分需要交替搜索最优参数。 待搜索的参数空间有上万维,如果参数搜索串行执行,那么上千次的迭代计算大约需要10个小时,对于线上部署的模型是万万不可取的。 考虑到参数搜索部分…...
集团网站建设的要求/seo优化排名公司
时间安排 7:00~7:10 先看题,三道计数,一道DS ,这个DS一看就很像树上莫队 7:10~7:40 T2套路地枚举中位数,然后就能dp了,有60pts,于是赶紧写 7:50~8:00 发现T3需要写平衡树,而且莫队套平衡树…...