I've added a web based VNC server to the container (
https://github.com/colinsauze/sail_sim_docker) so its easy to run it on any cloud system. I tried it on a few different configurations but had to allocate 32 CPU cores on AWS to get up to between 0.85 and 0.88 RTF. A 32 core cloud system costs about $1 per hour to run, so this wouldn't be too much to run a competition for a few days but might start to get expensive for teams to do development on.
I'm wondering if there's anything we can do to reduce demand on the CPU. I tried switching to wireframe view and making the gazebo window smaller but this didn't make much difference, perhaps 0.05 RTF at most. When I get a chance I'll see if I can work out which parts of the process are taking the most CPU time.
Colin.
________________________________________
From:
wrsc-d...@googlegroups.com [
wrsc-d...@googlegroups.com] on behalf of Yu Cao 曹宇 [
tsa...@gmail.com]
Sent: 09 September 2020 11:52
To: World Robotic Sailing Championships Discussions
Subject: Re: [sailbot] Re: Virtual WRSC and simulator
[RHYBUDD! E-BOST ALLANOL / CAUTION! EXTERNAL E-MAIL]
Two Ardupilot based sailing robots (both from Huazhong University of Science and Technology) have participated in WRSC 2019 already : )
On my computer (i9-9900K + 2080Ti), the simulation runs at 60 FPS with RTF about 0.97 ~ 0.98. I don't know if there are any losses due to the virtualization, but the hardware requirement for the virtual competition will at least similar to Rhys'. I have been contacting with some robotics research institutes to see if they are interested in cost-host this event and provide some free cloud service.
Wish we can find an hour or so for an online meeting to plan out the virtual simulation!
On Thursday, 3 September 2020 at 00:32:06 UTC+1 Rhys Mainwaring wrote:
Hi Colin,
I've posted some notes about the SITL performance on the Ardupilot sailboat thread
https://discuss.ardupilot.org/t/sailboat-support/32060/626<
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdiscuss.ardupilot.org%2Ft%2Fsailboat-support%2F32060%2F626&data=02%7C01%7C%7C483e299005e941c8569208d854ae6a10%7Cd47b090e3f5a4ca084d09f89d269f175%7C0%7C1%7C637352455364380436&sdata=OrlosX7RsGR4iduhexZiAd59cfEzL1StB4wMqfyPVpc%3D&reserved=0>. Depending on your environment and VM, the CPU load can be large as it has to simulate the physics (twice for the waves because of Gazebo's client / server model) and translate the OpenGL calls if there is no native support for OpenGL 2 and greater on the VM. On a VM with 4 CPU, 8GB RAM and hardware acceleration it should run at 30 FPS with a RTF of about 0.9 - 0.95.
I think SITL can support multiple drones, but I've not experimented. The SITL docker image was my first foray into ArduPilot so I'm still familiarising myself with its capabilities.
Gazebo and ROS will support multiple robots in the same simulation, provided that all the namespace logic is set up correctly. I have not implemented robot namespace in the proof of concept, but have examples of how to do this. There will of course be some performance impact. There are ways of mitigating this by simplifying the mesh used for the buoyancy dynamics and further limiting which objects are buoyant (at the moment its everything - including spars etc.)
If supporting multiple boats initially proves to be too computationally expensive, you could always simulate collision avoidance against static obstacles, or dynamic obstacles that are mocked up with no or very simplified buoyancy (e.g. to simulate a shipping lane or ferry crossing, or navigate an uncharted area).
In ROS you have access to simulated cameras and rangefinders. A number of teams have published packages for various sensors so it's a matter of selecting which ones you want and adding them to the vessel . Cameras are quite expensive to simulate as each one has to render the scene, so we may need to think about how that works when running multiple boats (you'd only want to render the camera feed for the boat your controlling, but still see the other boats in the main scene).
On the physics side there are a number of aspects which require tuning, and I have not spent a lot of time fitting the simulated vessel motion to experimental data (I'm in the process of putting a boat together at the moment which may eventually help fill that gap - but if you have real boat data or a VPP program that can generate it that would be very helpful). There will be limits to what can be achieved given the current approximations used.
The main variables for the hull are drag coefficients (effectively for form and viscous drag). We could tabulate expected constant velocities for a given hull form as a function of thrust force (or wind speed for a given sail plan), and try to fit the drag coefficients. I found that the hydrodynamics approximations did not give enough lift / drag for the fin and rudder, so there is an additional lift / drag plugin with its own coefficients. These can be adjusted to control side force, heel, leeway and turning radius. In the simulation you can see the rudder stall if turned too aggressively, and the fin stalls if the boat is pushed too close to the wind or at low velocities out of a tack.
I have some work in progress to improve the FFT waves. The current version has some scaling issues as the maximum wavelength and resolution are adjusted. There is also no spreading function to control wave direction. This may or may not be relevant for a first version. There is also work to support approx. reflection / refraction which can be relevant for camera work - again it's probably not a priority for an initial version which I'd recommend keeps to the basics but does them well.
Rhys
On Wednesday, September 2, 2020 at 4:39:17 PM UTC+1 Colin Sauze wrote:
Hi Rhys,
I'm still interested in trying to do something this year but haven't had much time recently as i've been trying to put a grant proposal together.
I've just run your SITL container and it looks pretty good. The only issue was that it only ran at about 0.3 times speed, but this was on a very slow virtual machine. I'll try again on a faster system and see if I get better performance.
Using ardupilot as a reference implementation seems like a good idea, I hadn't realised there was now a functional ardupilot for sailing boats available.
If there's already a good reference autopilot, this brings up the obvious question of what we are challenging the participants to produce for a virtual WRSC. The obvious things that I can think of is doing collaborative tasks between different boats or collision avoidance. This brings up the question, how difficult would it be to simultaneously simulate multiple boats?
The simple way to do this could be to run a separate simulator instance for each participant and have an external API (possibly the same one we've used for tracking real boats at the WRSC since 2015) that covers detecting other boats. But it would be really nice if we could do it all in one simulator instance and then we could access things such as simulated RADAR/LIDAR or cameras.
I've started a document on the technical requirements and some general ideas for a simulated WRSC, please add any thoughts to:
https://github.com/WRSC/simulation-challenge/blob/master/requirements.md<
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FWRSC%2Fsimulation-challenge%2Fblob%2Fmaster%2Frequirements.md&data=02%7C01%7C%7C483e299005e941c8569208d854ae6a10%7Cd47b090e3f5a4ca084d09f89d269f175%7C0%7C1%7C637352455364390431&sdata=r45LsfKIy3B0Wm8y9pWydzurWuyC9dWu34ELM2EypdI%3D&reserved=0>
Colin.
On 17/08/2020 16:23, 'Rhys Mainwaring' via World Robotic Sailing Championships Discussions wrote:
Hi everyone,
I'm not sure if there is still interest to run an event this year, but I've been working on improvements to the simulator in any case. I've put a proof of concept docker image out with ArduPilot integration - so you can run the simulation using SITL and MavProxy. The project is on a branch here:
https://github.com/srmainwaring/sail_sim_docker/tree/feature/ardupilot_sailboat_poc<
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsrmainwaring%2Fsail_sim_docker%2Ftree%2Ffeature%2Fardupilot_sailboat_poc&data=02%7C01%7C%7C483e299005e941c8569208d854ae6a10%7Cd47b090e3f5a4ca084d09f89d269f175%7C0%7C1%7C637352455364390431&sdata=dxyO8fUzRXBs01MV%2B0yRmeCbWZOzpyCfHFwsGfEOYFo%3D&reserved=0>
[thumbnail_Screenshot from 2020-06-21 19-59-27.png]In addition,
- Simulated sensor data such as anemometer, IMU, GPS are provided are ROS topic
- Sails and rudder are separately controllable with custom software
- Wind and wave parameters can be changed in the simulator
- Virtual camera plugin
- Near real-time simulation
We would like to invite colleagues to try this simulator and give us feedback. If there are enough teams interested in a virtual WRSC we can develop challenges based on this simulator.
Link to the simulator:
https://github.com/srmainwaring/sail_sim_docker<
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsrmainwaring%2Fsail_sim_docker&data=02%7C01%7C%7C483e299005e941c8569208d854ae6a10%7Cd47b090e3f5a4ca084d09f89d269f175%7C0%7C1%7C637352455364400424&sdata=2EQ%2B3mWvx27KHxV6jwS2r05tKNbo1XZQrhccHm%2FVOwQ%3D&reserved=0>
Best regards,
Yu
--
You received this message because you are subscribed to the Google Groups "World Robotic Sailing Championships Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
wrsc-discuss...@googlegroups.com.
To view this discussion on the web, visit
https://groups.google.com/d/msgid/wrsc-discuss/e4e040a7-411c-410d-8a7c-9b48cede83a6o%40googlegroups.com<
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fwrsc-discuss%2Fe4e040a7-411c-410d-8a7c-9b48cede83a6o%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=02%7C01%7C%7C483e299005e941c8569208d854ae6a10%7Cd47b090e3f5a4ca084d09f89d269f175%7C0%7C1%7C637352455364400424&sdata=MibnppzM56GGz719bPdMLyZmpomyJsFbuvNLzkg1Bv8%3D&reserved=0>.
Prifysgol Aberystwyth
www.aber.ac.uk/cy/<
http://www.aber.ac.uk/cy/>
Prifysgol y Flwyddyn yng Nghymru - The Times & The Sunday Times 2020.
Aberystwyth University
www.aber.ac.uk/en/<
http://www.aber.ac.uk/en/>
Welsh University of the Year - The Times & The Sunday Times 2020.
----------------------------------------------------------------------------------------------------------------------
--
You received this message because you are subscribed to the Google Groups "World Robotic Sailing Championships Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
wrsc-discuss...@googlegroups.com.
To view this discussion on the web, visit
https://groups.google.com/d/msgid/wrsc-discuss/fd3c1ce0-81b2-4110-a4e8-a5855c759156n%40googlegroups.com<
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fwrsc-discuss%2Ffd3c1ce0-81b2-4110-a4e8-a5855c759156n%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=02%7C01%7C%7C483e299005e941c8569208d854ae6a10%7Cd47b090e3f5a4ca084d09f89d269f175%7C0%7C1%7C637352455364410422&sdata=loX2%2B4qN4fuR2lCDWM4jw8hLfnO%2B%2BAkwPOIAEf0L138%3D&reserved=0>.
Prifysgol Aberystwyth
www.aber.ac.uk/cy/<
http://www.aber.ac.uk/cy/>
Prifysgol y Flwyddyn yng Nghymru - The Times & The Sunday Times 2020.
Aberystwyth University
www.aber.ac.uk/en/<
http://www.aber.ac.uk/en/>
Welsh University of the Year - The Times & The Sunday Times 2020.
----------------------------------------------------------------------------------------------------------------------
--
You received this message because you are subscribed to the Google Groups "World Robotic Sailing Championships Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
wrsc-discuss...@googlegroups.com.
To view this discussion on the web, visit
https://groups.google.com/d/msgid/wrsc-discuss/8e323e5c-d55b-46ba-813a-a333e9659d41n%40googlegroups.com<
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fwrsc-discuss%2F8e323e5c-d55b-46ba-813a-a333e9659d41n%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=02%7C01%7C%7C483e299005e941c8569208d854ae6a10%7Cd47b090e3f5a4ca084d09f89d269f175%7C0%7C0%7C637352455364420415&sdata=GLnvpNHuWgxGfabPsw9wEyFsy%2BSbJ%2BIJOmwwsNO%2FLOI%3D&reserved=0>.
--
Dr. Colin Sauze
Research Software Engineer
Supercomputing Wales Project
Room 2.16, Physical Sciences Building
Aberystwyth University,
Penglais, Aberystwyth
Ceredigion, UK, SY23 3DB
Tel:
+44 (0)1970 622774<tel:+44%201970%20622774>
Prifysgol Aberystwyth
www.aber.ac.uk/cy/<
http://www.aber.ac.uk/cy/>
Prifysgol y Flwyddyn yng Nghymru - The Times & The Sunday Times 2020.
Aberystwyth University
www.aber.ac.uk/en/<
http://www.aber.ac.uk/en/>
Welsh University of the Year - The Times & The Sunday Times 2020.
----------------------------------------------------------------------------------------------------------------------
--
You received this message because you are subscribed to the Google Groups "World Robotic Sailing Championships Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
wrsc-discuss...@googlegroups.com<mailto:
wrsc-discuss...@googlegroups.com>.
To view this discussion on the web, visit
https://groups.google.com/d/msgid/wrsc-discuss/63509e4e-da4d-4692-995b-9d216ba0ab4cn%40googlegroups.com<
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fwrsc-discuss%2F63509e4e-da4d-4692-995b-9d216ba0ab4cn%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=02%7C01%7C%7C483e299005e941c8569208d854ae6a10%7Cd47b090e3f5a4ca084d09f89d269f175%7C0%7C0%7C637352455364420415&sdata=vAMePJvsuCiGwnuR%2F%2FBrtTeNJYS32tXv%2ByqA2VqKnfo%3D&reserved=0>.