How can I change the direction in which my vehicle moves along the x-axis? Currently, my car is moving in the wrong direction (backwards), and I want to correct it so that when I give it a command to move, it goes in the desired x-axis direction. Alternatively, can I use negative acceleration to achieve the correct direction of movement?
Hello!
What method are you using? Are you using a python script to drive the servo directly, if so you can use a statement like “cont.move(-Long)” to make the vehicle go backwards. Actually, if you only need movement in one direction, you can check the movement direction setting of your Link, I think it may be set upside down.
from vcScript import *
import vcVector
def OnRun():
comp = getComponent()
vehicle = comp.getBehaviour('Vehicle')
vehicle.clearMove()
vehicle.Acceleration = 300.0
vehicle.Deceleration = 300.0
vehicle.MaxSpeed = 800.0
point = vcVector.new(1495, -3500, -500)
vehicle.addControlPoint(point)
signal = comp.findBehaviour("BooleanSignal")
triggerCondition(lambda:getTrigger()==signal and signal.Value)
vehicle.rePlan()#remove point
point = vcVector.new(-1495, 3500, 500)
vehicle.addControlPoint(point)
Is this what you want? I think you may not have deleted the points, which will lead to problems such as the addition of multiple vectors.Hope this helps, have a nice day.
I’m very sorry!
This may not help you, I may understand what you mean, I thought you need to move in the opposite direction after reaching a position, the BOOL signal is what I use to help control the car to move in the opposite direction. In fact, you can check the help manual about Vector, which can help you a lot. Sorry again for not being able to help you.
Vehicle AP, eh? It has been a long time. If I recall, one hack is to modify some orientation like component, node or the vehicle itself because it’s just a visualization and there is trickery. Otherwise, going bananas is one option where the vehicle behavior itself is not responsible for driving backwards rather another system or interpolater. For example, you could probably write a script to move the component along an axis over time to target location, and then give mastership back to the vehicle. I believe the vehicles in eCatalog have property for moving backward but there script takes time to ingest.
My suggestion is tell the vehicle to let go of the wheel and let another script or function take care of it.