Skip to content

Commit

Permalink
fix get_task_state mismatch variation (#18)
Browse files Browse the repository at this point in the history
* fix:bugfix

* fix:bugfix
  • Loading branch information
Cosmoflips authored Dec 26, 2022
1 parent 4777ebf commit 58ae72d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
6 changes: 3 additions & 3 deletions sdk/include/lebai/robot.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> & params);
unsigned int start_task(const std::string &name,bool is_main,unsigned int loop_to,const std::string &dir,const std::vector<std::string> & params);
/**
* @brief 调用场景
*
Expand All @@ -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 查询任务列表
*/
Expand Down
18 changes: 9 additions & 9 deletions sdk/src/robot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> & params)
unsigned int Robot::start_task(const std::string &name,bool is_parallel,unsigned int loop_to,const std::string & dir,const std::vector<std::string> & params)
{
control::StartTaskRequest req;
req.set_name(name);
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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";
}
}
Expand Down

0 comments on commit 58ae72d

Please sign in to comment.