Skip to content
Permalink
Browse files

Support the moteus based turret

  • Loading branch information...
jpieper committed Apr 30, 2019
1 parent c5703ed commit f68561e79d2ef2a977fc873e6b52a3d976e50d15
Showing with 274 additions and 87 deletions.
  1. +6 −0 configs/moteus.ini
  2. +7 −5 mech/mech_warfare.cc
  3. +256 −82 mech/turret.cc
  4. +5 −0 mech/turret.h
@@ -44,3 +44,9 @@ camera.preset=1
# we just do unicast
video_link.source=0.0.0.0
video_link.dest=192.168.2.42

[turret]

gimbal_address=32
use_moteus_turret=1
fire_motor_pwm=0.32
@@ -573,11 +573,6 @@ MechWarfare::MechWarfare(base::Context& context)
m_.servo.reset(new Mech::Servo(m_.servo_base.get()));
m_.moteus_servo = std::make_unique<MoteusServo>(service_);

m_.multiplex_client->RequestClient([this](const auto& ec, auto* client) {
mjlib::base::FailIf(ec);
m_.moteus_servo->SetClient(client);
});

m_.servo_selector = std::make_unique<ServoSelector>();
m_.servo_selector->AddInterface("herkulex", m_.servo.get());
m_.servo_selector->AddInterface("moteus", m_.moteus_servo.get());
@@ -594,6 +589,13 @@ MechWarfare::MechWarfare(base::Context& context)
m_.servo_monitor.reset(new ServoMonitor(context, m_.servo_iface.get()));
m_.servo_monitor->parameters()->servos = "0-11,98";
m_.turret.reset(new Turret(context, m_.servo_base.get()));

m_.multiplex_client->RequestClient([this](const auto& ec, auto* client) {
mjlib::base::FailIf(ec);
m_.moteus_servo->SetClient(client);
m_.turret->SetMultiplexClient(client);
});

m_.video.reset(new VideoSenderApp(context));

impl_->telemetry_ = m_.video->telemetry_interface().lock();
Oops, something went wrong.

0 comments on commit f68561e

Please sign in to comment.
You can’t perform that action at this time.