Vehicle Position on Track

Hello Onish,

Is this a separate ROS node or a CPP file that is being added to the main CarMaker executable?

The Vehicle data is technically only available when you are inside the main CarMaker executable. The CarMaker ROS node CMNode_ROS1_HelloCM.cpp is actually compiled and linked to that executable, so it has direct access to the internal CM libraries and code that allow interaction with the API and reading of these values.

If you are creating a completely separate ROS node or a CPP file that is not packaged inside CarMaker.linux64, getting to this value purely over C/CPP might be quite tricky.

The function that you wrote can probably work if you manage to somehow include it in the standard project SRC folder (not the ROS sources, but rather <project_root>/src), but I have the feeling that you are trying to create a separate ROS node. In that case, your best bet is to access Vehicle.tRoad from CMNode_ROS1_HelloCM and then publish it over ROS.