Skip to content

Commit

Permalink
Canbus : update the vehicle factory and register it as GEM
Browse files Browse the repository at this point in the history
  • Loading branch information
Capri2014 authored and xiaoxq committed Apr 5, 2018
1 parent 02fc69c commit 0ce5dbf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/canbus/conf/canbus_conf.pb.txt
@@ -1,5 +1,5 @@
vehicle_parameter {
brand: LINCOLN_MKZ
brand: GEM
max_steer_angle: 470.0
max_steer_angle_spd: 500.0
min_steer_angle_spd: 100.0
Expand Down
1 change: 1 addition & 0 deletions modules/canbus/proto/vehicle_parameter.proto
Expand Up @@ -7,6 +7,7 @@ import "modules/canbus/proto/chassis.proto";
message VehicleParameter {
enum VehicleBrand {
LINCOLN_MKZ = 0;
GEM = 1;
}

optional VehicleBrand brand = 1;
Expand Down
4 changes: 4 additions & 0 deletions modules/canbus/vehicle/vehicle_factory.cc
Expand Up @@ -16,6 +16,7 @@

#include "modules/canbus/vehicle/vehicle_factory.h"
#include "modules/canbus/proto/vehicle_parameter.pb.h"
#include "modules/canbus/vehicle/gem/gem_vehicle_factory.h"
#include "modules/canbus/vehicle/lincoln/lincoln_vehicle_factory.h"

namespace apollo {
Expand All @@ -25,6 +26,9 @@ void VehicleFactory::RegisterVehicleFactory() {
Register(VehicleParameter::LINCOLN_MKZ, []() -> AbstractVehicleFactory * {
return new LincolnVehicleFactory();
});
Register(VehicleParameter::GEM, []() -> AbstractVehicleFactory * {
return new GemVehicleFactory();
});
}

std::unique_ptr<AbstractVehicleFactory> VehicleFactory::CreateVehicle(
Expand Down

0 comments on commit 0ce5dbf

Please sign in to comment.