change set motion command function

This commit is contained in:
wangzheqie
2021-04-22 20:21:17 +08:00
parent d6c06897d3
commit 74d2c7e894
2 changed files with 7 additions and 5 deletions

View File

@@ -66,7 +66,8 @@ class RangerBase : public AgilexBase {
void Connect(std::string dev_name) override; void Connect(std::string dev_name) override;
// robot control // robot control
void SetMotionCommand(double linear_vel, double angular_vel); void SetMotionCommand(double linear_vel, double steer_angle,
double lateral_vel = 0.0, double angular_vel = 0.0);
void SetLightCommand(const RangerLightCmd &cmd); void SetLightCommand(const RangerLightCmd &cmd);
void SetMotionMode(uint8_t mode); void SetMotionMode(uint8_t mode);

View File

@@ -29,8 +29,10 @@ void RangerBase::Connect(std::string dev_name) {
std::placeholders::_1)); std::placeholders::_1));
} }
void RangerBase::SetMotionCommand(double linear_vel, double angular_vel) { void RangerBase::SetMotionCommand(double linear_vel, double steer_angle,
AgilexBase::SetMotionCommand(linear_vel, 0.0, 0.0, angular_vel/10.0); double lateral_vel, double angular_vel) {
AgilexBase::SetMotionCommand(linear_vel, angular_vel, lateral_vel,
steer_angle / 10.0);
} }
void RangerBase::SetLightCommand(const RangerLightCmd &cmd) { void RangerBase::SetLightCommand(const RangerLightCmd &cmd) {
@@ -40,8 +42,7 @@ void RangerBase::SetLightCommand(const RangerLightCmd &cmd) {
} }
} }
void RangerBase::SetMotionMode(uint8_t mode) void RangerBase::SetMotionMode(uint8_t mode) {
{
AgilexBase::SetMotionMode(mode); AgilexBase::SetMotionMode(mode);
} }