diff --git a/CMakeLists.txt b/CMakeLists.txt index 3263199..77a3f2c 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") option(CMAKE_EXPORT_COMPILE_COMMANDS "Export compile command" TRUE) -project(lebai VERSION 1.0.9 LANGUAGES CXX) +project(lebai VERSION 1.0.10 LANGUAGES CXX) set(PROJECT_NAMESPACE lebai) message(STATUS "${PROJECT_NAME} version: ${PROJECT_VERSION}") # message(STATUS "major: ${PROJECT_VERSION_MAJOR}") diff --git a/sdk/include/lebai/robot.hh b/sdk/include/lebai/robot.hh index 49c84b2..907608c 100644 --- a/sdk/include/lebai/robot.hh +++ b/sdk/include/lebai/robot.hh @@ -635,7 +635,7 @@ namespace lebai * @param dir: 调用场景所在的文件夹名 * @param params: 其他参数 */ - unsigned int scene(const std::string &name,bool is_main,unsigned int loop_to,const std::string &dir,const std::vector & params); + unsigned int start_task(const std::string &name,bool is_main,unsigned int loop_to,const std::string &dir,const std::vector & params); /** * @brief 调用场景 * @@ -644,13 +644,13 @@ namespace lebai * @param loop_to: 循环次数(默认0永久循环) * @param dir: 调用场景所在的文件夹名 */ - unsigned int scene(const std::string &name,bool is_main,unsigned int loop_to,const std::string &dir); + unsigned int start_task(const std::string &name,bool is_main,unsigned int loop_to,const std::string &dir); /** * @brief 调用场景 * * @param name: 调用场景的名字 */ - unsigned int scene(const std::string &name); + unsigned int start_task(const std::string &name); /** * @brief 查询任务列表 */ diff --git a/sdk/src/robot.cc b/sdk/src/robot.cc index c30e342..f620a5a 100644 --- a/sdk/src/robot.cc +++ b/sdk/src/robot.cc @@ -979,7 +979,7 @@ void Robot::add_signal(unsigned int index,int value) impl_->addSignal(req); } -unsigned int Robot::scene(const std::string &name,bool is_parallel,unsigned int loop_to,const std::string & dir,const std::vector & params) +unsigned int Robot::start_task(const std::string &name,bool is_parallel,unsigned int loop_to,const std::string & dir,const std::vector & params) { control::StartTaskRequest req; req.set_name(name); @@ -990,7 +990,7 @@ unsigned int Robot::scene(const std::string &name,bool is_parallel,unsigned int control::TaskIndex resp = impl_->scene(req); return resp.id(); } -unsigned int Robot::scene(const std::string &name,bool is_parallel,unsigned int loop_to,const std::string & dir) +unsigned int Robot::start_task(const std::string &name,bool is_parallel,unsigned int loop_to,const std::string & dir) { control::StartTaskRequest req; req.set_name(name); @@ -1000,7 +1000,7 @@ unsigned int Robot::scene(const std::string &name,bool is_parallel,unsigned int control::TaskIndex resp = impl_->scene(req); return resp.id(); } -unsigned int Robot::scene(const std::string &name) +unsigned int Robot::start_task(const std::string &name) { control::StartTaskRequest req; req.set_name(name); @@ -1041,12 +1041,12 @@ std::string Robot::get_task_state(unsigned int id) control::Task resp = impl_->loadTask(req); switch(resp.state()) { - case 0:return "WAIT";break; - case 1:return "RUNNING";break; - case 2:return "PAUSE";break; - case 3:return "SUCCESS";break; - case 4:return "INTERRUPT";break; - case 5:return "FAIL";break; + case control::TaskState::WAIT:return "WAIT";break; + case control::TaskState::RUNNING:return "RUNNING";break; + case control::TaskState::PAUSE:return "PAUSE";break; + case control::TaskState::SUCCESS:return "SUCCESS";break; + case control::TaskState::INTERRUPT:return "INTERRUPT";break; + case control::TaskState::FAIL:return "FAIL";break; default:return "Undefined State"; } }