Prescan code generation - AD-EYE/AD-EYE_Core GitHub Wiki
Preparation
1. Install Prescan: (might be already installed)
First, you can verify if you have already installed Prescan on your computer.
ls /usr/local
You can choose in these folders and sub-folders the version you are looking for. But we recommend using the version 2020.4.
https://kth.app.box.com/folder/53896402743
- Ubuntu:
Download the file
Simcenter-Prescan-2020.X.0-lin64.sh
To execute it, go in the right path then:
chmod +x Simcenter-Prescan-2020.4.0-lin64.sh
sudo ./Simcenter-Prescan-2020.4.0-lin64.sh
You can verify once more with ls /usr/local
- Windows:
[not yet determined]
2. Edit Prescanrun:
- Verify that the environment variable which defines the Prescan License server is included in the service definition, otherwise include it.
sudo nano /etc/systemd/system/deploymentservice.service
On Prescan 2020.1: [email protected]
On Prescan 2020.3: [email protected]
On Prescan 2020.4: [email protected]
-
Additionally, make sure that the username in the service definition is not "prescan", it should be the default username in the computer.
-
Don't forget to update the version in the ExecStart line.
The service definition should look similar to the following:
[Unit]
Description="Prescan Deployment Service"
Wants=network-online.target
After=network.target network-online.target
[Service]
[email protected]
User=adeye
ExecStart=/usr/local/Prescan_2020.3.0/bin/prescanrun DeploymentService
[Install]
WantedBy=multi-user.target
- Reload changes and test that the service works
sudo systemctl daemon-reload
sudo systemctl restart deploymentservice.service
sudo systemctl status deploymentservice.service # just to see if the service is working properly
- Enable the service on startup
sudo systemctl enable deploymentservice.service
build_and_run_experiment.sh
:
3. Modify Download this folder: https://gits-15.sys.kth.se/AD-EYE/prescan_code_generation
Depending on the simulation conventions, it might be necessary to change two constants in the build_and_run_experiment.sh
script. For example:
- For a default PreScan experiment:
PRESCAN_EXPERIMENT_FOLDER="Experiment"
EXPERIMENT_NAME="Experiment"
- For an AD-EYE experiment like W01_Base_Map_TCP:
PRESCAN_EXPERIMENT_FOLDER="W01_Base_Map_TCP"
EXPERIMENT_NAME="W01_Base_Map_TCP"
Then correct the PRESCANRUN_PATH
line below with your Prescan's version (2020.1 or 2020.3 or 2020.4).
Below the line original_path=(pwd)
, add the line: (in function of your version, see above)
export [email protected]
Now you can save this file and close it.
Execution
In 4 separate terminals:
- Run roscore
roscore
- Run my server (which is a package):
rosrun packageImageRviz myServer
- Run the PreScan generated code (which includes the rosbridge TCP client):
Go in the path where you downloaded this.
Then in /prescan_code_generation-master/scripts
./build_and_run_experiment.sh ~/Downloads/W01_Base_Map_TCP_cs.zip
- Run Rviz:
rviz
Add an image, and select the topic /topic_image
The simulation will start running.