Aikido
Robot-impl.hpp
Go to the documentation of this file.
1 namespace aikido {
2 namespace robot {
3 
4 //==============================================================================
5 template <aikido::control::ExecutorType T>
6 std::future<int> Robot::executeJointCommand(
7  const std::vector<double>& command,
8  const std::chrono::duration<double>& timeout)
9 {
10  // Retrieve active executor
11  if (mActiveExecutor < 0)
12  {
13  return common::make_exceptional_future<int>(
14  "executeJointCommand: No active executor");
15  }
16 
17  std::shared_ptr<aikido::control::JointCommandExecutor<T>> executor;
18  executor
19  = std::dynamic_pointer_cast<aikido::control::JointCommandExecutor<T>>(
21  if (!executor)
22  {
23  return common::make_exceptional_future<int>(
24  "executeJointCommand: Active executor not correct type.");
25  }
26 
27  return executor->execute(command, timeout);
28 }
29 
30 //==============================================================================
31 extern template std::future<int>
32 Robot::executeJointCommand<aikido::control::ExecutorType::POSITION>(
33  const std::vector<double>& command,
34  const std::chrono::duration<double>& timeout);
35 
36 extern template std::future<int>
37 Robot::executeJointCommand<aikido::control::ExecutorType::VELOCITY>(
38  const std::vector<double>& command,
39  const std::chrono::duration<double>& timeout);
40 
41 extern template std::future<int>
42 Robot::executeJointCommand<aikido::control::ExecutorType::EFFORT>(
43  const std::vector<double>& command,
44  const std::chrono::duration<double>& timeout);
45 
46 } // namespace robot
47 } // namespace aikido
aikido::robot::Robot::executeJointCommand
std::future< int > executeJointCommand(const std::vector< double > &command, const std::chrono::duration< double > &timeout)
Convenience: executes given joint command on the robot.
Definition: Robot-impl.hpp:6
aikido
Format of serialized trajectory in YAML.
Definition: algorithm.hpp:4
aikido::robot::Robot::mActiveExecutor
int mActiveExecutor
Definition: Robot.hpp:442
aikido::robot::Robot::mExecutors
std::vector< aikido::control::ExecutorPtr > mExecutors
Definition: Robot.hpp:444