![]() ![]() In order to compile and execute extern controllers, the following environment variables should be set:Įxport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/snap/webots/current/usr/lib/x86_64-linux-gnuĮxport LD_PRELOAD=/snap/webots/current/usr/lib/x86_64-linux-gnu/libz.soīecause of the snap sand-boxing system, Webots has to use a special temporary folder to share information with robot controllers. Running Extern Robot Controller with the Snap Version of Webots Note: the environment variables can be set inside the controller program, before calling the wb_robot_init() function. If that simulation has more than one extern controller, you may also set the WEBOTS_ROBOT_NAME environment variable to specify the robot to which your controller should connect. This can be achieved by setting an environment variable named WEBOTS_PID with the PID (Process ID) of the running Webots instance to which you want to connect your controller. If you are running multiple simulations simultaneously on the same machine, then you need to indicate to your controller to which instance of Webots it should try to connect. Note: if the WEBOTS_ROBOT_NAME is not set, the controller will connect to the first extern robot found which is not already connected to an extern controller. You can repeat this for the other controllers, e.g., set a different value to the WEBOTS_ROBOT_NAME environment variable before starting a new controller, so that it will connect to a different robot. Once this environment variable is set, you can launch your controller and it will connect to the extern robot whose name matches the one provided in the environment variable. Then, in the environment from which you are going to launch the extern controller, you should define an environment variable named WEBOTS_ROBOT_NAME and set it to match the name field of the Robot node you want to control. In this case, for each robot that you want to control externally, you should set their controller field to. You are running a single Webots simulation simultaneously on the same machine and this simulation has several robots that you want to control from extern controllers. Single Simulation and Multiple Extern Robot Controllers In this case, you simply need to set the controller field of this robot to and to launch the controller program from a console or from your favorite IDE. You are running a single Webots simulation simultaneously on the same machine and this simulation has only one robot that you want to control from an extern controller.
0 Comments
Leave a Reply. |