mirror of
https://github.com/modelec/modelec-marcel-ROS.git
synced 2026-01-18 16:47:43 +01:00
servo value
This commit is contained in:
@@ -41,13 +41,9 @@ namespace Modelec
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
virtual ~BaseAction() = default;
|
virtual ~BaseAction() = default;
|
||||||
virtual void Execute() = 0;
|
|
||||||
virtual void Next() = 0;
|
virtual void Next() = 0;
|
||||||
virtual bool IsDone() const { return done_; }
|
virtual bool IsDone() const { return done_; }
|
||||||
virtual void Init(const std::vector<std::string>& params) = 0;
|
virtual void Init(const std::vector<std::string>& params) = 0;
|
||||||
|
|
||||||
// static constexpr std::string_view Name = "BaseAction";
|
|
||||||
|
|
||||||
static Ptr CreateAction(
|
static Ptr CreateAction(
|
||||||
const std::string& action_name,
|
const std::string& action_name,
|
||||||
const std::shared_ptr<ActionExecutor>& action_executor);
|
const std::shared_ptr<ActionExecutor>& action_executor);
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ namespace Modelec
|
|||||||
DownAction(const std::shared_ptr<ActionExecutor>& action_executor);
|
DownAction(const std::shared_ptr<ActionExecutor>& action_executor);
|
||||||
DownAction(const std::shared_ptr<ActionExecutor>& action_executor, bool front);
|
DownAction(const std::shared_ptr<ActionExecutor>& action_executor, bool front);
|
||||||
|
|
||||||
void Execute() override;
|
|
||||||
void Next() override;
|
void Next() override;
|
||||||
void Init(const std::vector<std::string>& params) override;
|
void Init(const std::vector<std::string>& params) override;
|
||||||
void SetFront(bool front);
|
void SetFront(bool front);
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ namespace Modelec
|
|||||||
FreeAction(const std::shared_ptr<ActionExecutor>& action_executor);
|
FreeAction(const std::shared_ptr<ActionExecutor>& action_executor);
|
||||||
FreeAction(const std::shared_ptr<ActionExecutor>& action_executor, bool front, int n);
|
FreeAction(const std::shared_ptr<ActionExecutor>& action_executor, bool front, int n);
|
||||||
|
|
||||||
void Execute() override;
|
|
||||||
void Next() override;
|
void Next() override;
|
||||||
void Init(const std::vector<std::string>& params) override;
|
void Init(const std::vector<std::string>& params) override;
|
||||||
void SetFront(bool front);
|
void SetFront(bool front);
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ namespace Modelec
|
|||||||
TakeAction(const std::shared_ptr<ActionExecutor>& action_executor);
|
TakeAction(const std::shared_ptr<ActionExecutor>& action_executor);
|
||||||
TakeAction(const std::shared_ptr<ActionExecutor>& action_executor, bool front, int n);
|
TakeAction(const std::shared_ptr<ActionExecutor>& action_executor, bool front, int n);
|
||||||
|
|
||||||
void Execute() override;
|
|
||||||
void Next() override;
|
void Next() override;
|
||||||
void Init(const std::vector<std::string>& params) override;
|
void Init(const std::vector<std::string>& params) override;
|
||||||
|
void Init(bool front, int n);
|
||||||
void SetFront(bool front);
|
void SetFront(bool front);
|
||||||
void SetN(int n);
|
void SetN(int n);
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ namespace Modelec
|
|||||||
UPAction(const std::shared_ptr<ActionExecutor>& action_executor);
|
UPAction(const std::shared_ptr<ActionExecutor>& action_executor);
|
||||||
UPAction(const std::shared_ptr<ActionExecutor>& action_executor, bool front);
|
UPAction(const std::shared_ptr<ActionExecutor>& action_executor, bool front);
|
||||||
|
|
||||||
void Execute() override;
|
|
||||||
void Next() override;
|
void Next() override;
|
||||||
void Init(const std::vector<std::string>& params) override;
|
void Init(const std::vector<std::string>& params) override;
|
||||||
void SetFront(bool front);
|
void SetFront(bool front);
|
||||||
|
|||||||
@@ -13,10 +13,6 @@ Modelec::DownAction::DownAction(const std::shared_ptr<ActionExecutor>& action_ex
|
|||||||
front_ = front;
|
front_ = front;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Modelec::DownAction::Execute()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void Modelec::DownAction::Next()
|
void Modelec::DownAction::Next()
|
||||||
{
|
{
|
||||||
if (steps_.empty())
|
if (steps_.empty())
|
||||||
|
|||||||
@@ -14,10 +14,6 @@ Modelec::FreeAction::FreeAction(const std::shared_ptr<ActionExecutor>& action_ex
|
|||||||
n_ = n;
|
n_ = n;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Modelec::FreeAction::Execute()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void Modelec::FreeAction::Next()
|
void Modelec::FreeAction::Next()
|
||||||
{
|
{
|
||||||
if (steps_.empty())
|
if (steps_.empty())
|
||||||
@@ -38,7 +34,7 @@ void Modelec::FreeAction::Next()
|
|||||||
msg.items.resize(1);
|
msg.items.resize(1);
|
||||||
|
|
||||||
msg.items[0].id = n_ + (front_ ? 3 : 11);
|
msg.items[0].id = n_ + (front_ ? 3 : 11);
|
||||||
msg.items[0].start_angle = front_ ? 2.7 : 0;
|
msg.items[0].start_angle = front_ ? 2.5 : 0;
|
||||||
msg.items[0].end_angle = front_ ? 0.8 : 0;
|
msg.items[0].end_angle = front_ ? 0.8 : 0;
|
||||||
msg.items[0].duration_s = 0.5;
|
msg.items[0].duration_s = 0.5;
|
||||||
action_executor_->MoveServoTimed(msg);
|
action_executor_->MoveServoTimed(msg);
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
Modelec::TakeAction::TakeAction(const std::shared_ptr<ActionExecutor>& action_executor) : BaseAction(action_executor)
|
Modelec::TakeAction::TakeAction(const std::shared_ptr<ActionExecutor>& action_executor) : BaseAction(action_executor)
|
||||||
{
|
{
|
||||||
steps_.push(ActionExec::TAKE_STEP);
|
|
||||||
steps_.push(ActionExec::DONE_STEP);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Modelec::TakeAction::TakeAction(const std::shared_ptr<ActionExecutor>& action_executor, bool front, int n) : TakeAction(action_executor)
|
Modelec::TakeAction::TakeAction(const std::shared_ptr<ActionExecutor>& action_executor, bool front, int n) : TakeAction(action_executor)
|
||||||
@@ -14,10 +12,6 @@ Modelec::TakeAction::TakeAction(const std::shared_ptr<ActionExecutor>& action_ex
|
|||||||
n_ = n;
|
n_ = n;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Modelec::TakeAction::Execute()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void Modelec::TakeAction::Next()
|
void Modelec::TakeAction::Next()
|
||||||
{
|
{
|
||||||
if (steps_.empty())
|
if (steps_.empty())
|
||||||
@@ -63,6 +57,10 @@ void Modelec::TakeAction::Init(const std::vector<std::string>& params)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Modelec::TakeAction::Init(bool front, int n)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void Modelec::TakeAction::SetFront(bool front)
|
void Modelec::TakeAction::SetFront(bool front)
|
||||||
{
|
{
|
||||||
front_ = front;
|
front_ = front;
|
||||||
|
|||||||
@@ -13,10 +13,6 @@ Modelec::UPAction::UPAction(const std::shared_ptr<ActionExecutor>& action_execut
|
|||||||
front_ = front;
|
front_ = front;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Modelec::UPAction::Execute()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void Modelec::UPAction::Next()
|
void Modelec::UPAction::Next()
|
||||||
{
|
{
|
||||||
if (steps_.empty())
|
if (steps_.empty())
|
||||||
@@ -52,7 +48,7 @@ void Modelec::UPAction::Next()
|
|||||||
|
|
||||||
msg.items[3].id = front_ ? 3 : 11;
|
msg.items[3].id = front_ ? 3 : 11;
|
||||||
msg.items[3].start_angle = front_ ? 3 : 0;
|
msg.items[3].start_angle = front_ ? 3 : 0;
|
||||||
msg.items[3].end_angle = front_ ? 2.7 : 0;
|
msg.items[3].end_angle = front_ ? 2.5 : 0;
|
||||||
msg.items[3].duration_s = 1;
|
msg.items[3].duration_s = 1;
|
||||||
|
|
||||||
action_executor_->MoveServoTimed(msg);
|
action_executor_->MoveServoTimed(msg);
|
||||||
|
|||||||
Reference in New Issue
Block a user