Encountering problems with adding a 4-motor power system to the vehicle

21 views
Skip to first unread message

欧阳逸云

unread,
Dec 13, 2024, 10:30:07 AM12/13/24
to ProjectChrono
Hello everyone, this is my first time here and I am not familiar with the relevant posting rules. I apologize for any inconvenience caused.
I need to add an electric motor to each wheel of the vehicle to drive it independently. Currently, this is done as follows:
```
auto front_l_motor = chrono_types::make_shared<ChLinkMotorRotationSpeed>();
auto front_left_wheel = vehicle.GetWheel(0, VehicleSide::LEFT);
front_l_motor->Initialize(
front_left_wheel->GetSpindle(),
// vehicle.GetChassisBody(),
// vehicle.GetSteering(0)->GetSteeringLink(),
front_axle->m_suspension->GetSpindle(LEFT),
false,
front_left_wheel->GetPos(),
front_left_wheel->GetPos(),
ChVector3d(0, 1, 0),
ChVector3d(0, 1, 0)
);
vehicle.GetSystem()->Add(front_l_motor);
front_l_motor->SetSpeedFunction(chrono_types::make_shared<ChFunctionConst>(10.0));
```
```
driver.SetSteering(0.5); //Unable to turn
```
At present, the wheels can rotate normally, but it seems that the direction of the wheels is constrained, the steering control cannot be used, and the throttle is also ineffective. After multiple attempts and experiments, I still cannot solve this problem. I hope to receive help
Reply all
Reply to author
Forward
0 new messages