simulator
simulator copied to clipboard
Possible inconsistency object type of Waypoint acceleration
Hi SVL team,
I meet some problem when I was using waypoints following in Python API in SVL. The error message shows that some type can not be serialized into JSON when sending remote control command. After I checked the internal code, I found the root cause is that the acceleration field of lgsvl.DriveWaypoint will be a Vector while JSON does not support a Vector object. The error will happen at "lgsvl/agent.py" line 296 self.remote.command(...).
My current solution is that I manually set the acceleration to be a constant value the error will not occur. I am wondering what should be the default type of acceleration.
Thanks a lot!
We have helper methods to convert vectors, see Vector.fromJSON(); I am not sure how you are getting this error. Is this from your own api code?
The error python code I wrote can be simplified as: wp = lgsvl.DriveWaypoint(state.position, 5, angle = state.rotation) npc.follow(waypoints = [wp])
Somehow the acceleration of wp is Vector and also in the agent.py, when generating the cmd, the to_json() method is not called.
Thanks a lot for your reply and help! Really appreciate it!