Skip to content

Commit

Permalink
Add in Lunar world with representative terrain and lighting (resolves #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Taaj Street authored and Munir Azme committed Sep 9, 2024
1 parent 333a1f6 commit f776c9e
Show file tree
Hide file tree
Showing 43 changed files with 159,692 additions and 0 deletions.
26 changes: 26 additions & 0 deletions lunarsim_demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# LunarSim Demo
[![Licence](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\
This folder containts three ROS2 packages for to enable simulation in a lunar environment, including a lunar gazebo world using a Digital Elevation Model (DEM) and a plugin for a dynamic sun model based on Ephemeris data.

Instructions for building this package can be found in the space-ros-docker repo.

## lunar_sun_gz_plugin
This package contains a gazebo plugin to move an actor and create a light source at the location of the actor.
The plugin must be added to an actor named `animated_sun`, which can be done as follows:
```
<actor name="animated_sun">
<plugin name="LunarSun" filename="liblunar_sun_gz_plugin.so"/>
Other tags ...
</actor>
```
The suns trajectory is based on the `horizons_az_el.csv` file. Detailed documentation on updating this can be found on the space-ros lunarsim docs page.

## lunarsim_gz_worlds
This package contains the lunarsim world files, including the world sdf, DEM files, textures and tools for creating textures. It also contains the `display.launch.py` launch file, which launches gazebo with the lenarsim world by default (but does not spawn the rover). For detailed documentation on updating DEM model and textures see the space-ros lunarsim docs page.

## lunarsim_gz_bringup
This package contains launch and configuration files to launch the lunarsim world and spawn [leo_rover](https://github.com/LeoRover) with keyboard controls. The `spawn_leo_robot.launch.py` spawns the leo model, starts`gz_bridge` and `key_teleop`. The `gz_bridge` parameters can be modified in the `leo_ros_gz_bridge.yaml` file in the config directory.

Challenge Name: NASA Space ROS Sim Summer Sprint Challenge \
Team Lead Freelancer Username: elementrobotics \
Submission Title: LunarSim
27 changes: 27 additions & 0 deletions lunarsim_demo/lunar_sun_gz_plugin/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package leo_gz_plugins
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1.0.0 (2023-11-08)
------------------
* Fix warning about unused parameter
* Update rosdeps
* Fix wrong import and code formatting
* Simplify directives in diff system plugin
* Add missing dependencies and better descriptions
* Update hooks and naming conventions
* CMakeLists cleanup
* Fix CMakeLists.txt logic
* Add default gazebo version as fortress
* Update package.xml files and copyright notices
* Update copyright notices
* Format XML files
* Add copyright notices
* CI fix imports and whitespaces
* Fix CI failure for launch and cpp files
* Add CI (`#1 <https://github.com/LeoRover/leo_simulator-ros2/issues/1>`_)
* Change project versions
* Add package descriptions
* Change diff system plugin to require one file
* first semi-stable version
* Contributors: Błażej Sowa, Jan Hernas
55 changes: 55 additions & 0 deletions lunarsim_demo/lunar_sun_gz_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
cmake_minimum_required(VERSION 3.8)
project(lunar_sun_gz_plugin)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find_package(ament_cmake REQUIRED)

add_library(lunar_sun_gz_plugin SHARED
src/lunar_sun.cpp)

if(DEFINED ENV{GZ_VERSION} AND "$ENV{GZ_VERSION}" STREQUAL "garden")
find_package(gz-plugin2 REQUIRED COMPONENTS register)
set(GZ_PLUGIN_VER ${gz-plugin2_VERSION_MAJOR})

find_package(gz-sim7 REQUIRED)
set(GZ_SIM_VER ${gz-sim7_VERSION_MAJOR})

target_link_libraries(lunar_sun_gz_plugin
gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER}
gz-plugin${GZ_PLUGIN_VER}::gz-plugin${GZ_PLUGIN_VER}
)
else()
#If GZ_VERSION is not set default to Fortress
find_package(ignition-plugin1 REQUIRED COMPONENTS register)
set(IGN_PLUGIN_VER ${ignition-plugin1_VERSION_MAJOR})

find_package(ignition-gazebo6 REQUIRED)
set(IGN_GAZEBO_VER ${ignition-gazebo6_VERSION_MAJOR})

add_definitions(-DUSE_IGNITION)

target_link_libraries(lunar_sun_gz_plugin
ignition-gazebo${IGN_GAZEBO_VER}::ignition-gazebo${IGN_GAZEBO_VER}
ignition-plugin${IGN_PLUGIN_VER}::ignition-plugin${IGN_PLUGIN_VER}
)
endif()

set_property(TARGET lunar_sun_gz_plugin PROPERTY CXX_STANDARD 17)

install(
TARGETS
lunar_sun_gz_plugin
DESTINATION lib
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

ament_environment_hooks("${CMAKE_CURRENT_SOURCE_DIR}/hooks/gz_sim_system_plugin_path.dsv")

ament_package()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
prepend-non-duplicate;GZ_SIM_SYSTEM_PLUGIN_PATH;lib
98 changes: 98 additions & 0 deletions lunarsim_demo/lunar_sun_gz_plugin/horizons_az_el.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
Date__(UT)__HR:MN,Azimuth,Elevation
2024-Aug-12 00:00,29.321225,1.240311
2024-Aug-12 01:00,28.812252,1.253037
2024-Aug-12 02:00,28.303282,1.265572
2024-Aug-12 03:00,27.794317,1.277915
2024-Aug-12 04:00,27.285356,1.290064
2024-Aug-12 05:00,26.776399,1.302019
2024-Aug-12 06:00,26.267446,1.313778
2024-Aug-12 07:00,25.758497,1.325342
2024-Aug-12 08:00,25.249553,1.336709
2024-Aug-12 09:00,24.740613,1.347878
2024-Aug-12 10:00,24.231678,1.358848
2024-Aug-12 11:00,23.722748,1.369619
2024-Aug-12 12:00,23.213822,1.380190
2024-Aug-12 13:00,22.704902,1.390561
2024-Aug-12 14:00,22.195986,1.400730
2024-Aug-12 15:00,21.687075,1.410696
2024-Aug-12 16:00,21.178170,1.420460
2024-Aug-12 17:00,20.669270,1.430020
2024-Aug-12 18:00,20.160376,1.439375
2024-Aug-12 19:00,19.651487,1.448526
2024-Aug-12 20:00,19.142604,1.457471
2024-Aug-12 21:00,18.633726,1.466209
2024-Aug-12 22:00,18.124855,1.474741
2024-Aug-12 23:00,17.615989,1.483065
2024-Aug-13 00:00,17.107130,1.491182
2024-Aug-13 01:00,16.598277,1.499090
2024-Aug-13 02:00,16.089430,1.506788
2024-Aug-13 03:00,15.580590,1.514277
2024-Aug-13 04:00,15.071756,1.521556
2024-Aug-13 05:00,14.562929,1.528624
2024-Aug-13 06:00,14.054109,1.535481
2024-Aug-13 07:00,13.545297,1.542127
2024-Aug-13 08:00,13.036491,1.548560
2024-Aug-13 09:00,12.527692,1.554781
2024-Aug-13 10:00,12.018901,1.560790
2024-Aug-13 11:00,11.510118,1.566585
2024-Aug-13 12:00,11.001342,1.572166
2024-Aug-13 13:00,10.492574,1.577533
2024-Aug-13 14:00,9.983814,1.582687
2024-Aug-13 15:00,9.475062,1.587625
2024-Aug-13 16:00,8.966318,1.592349
2024-Aug-13 17:00,8.457582,1.596857
2024-Aug-13 18:00,7.948855,1.601151
2024-Aug-13 19:00,7.440137,1.605228
2024-Aug-13 20:00,6.931427,1.609089
2024-Aug-13 21:00,6.422726,1.612735
2024-Aug-13 22:00,5.914034,1.616164
2024-Aug-13 23:00,5.405351,1.619376
2024-Aug-14 00:00,4.896678,1.622372
2024-Aug-14 01:00,4.388014,1.625151
2024-Aug-14 02:00,3.879359,1.627713
2024-Aug-14 03:00,3.370714,1.630058
2024-Aug-14 04:00,2.862079,1.632186
2024-Aug-14 05:00,2.353454,1.634096
2024-Aug-14 06:00,1.844839,1.635790
2024-Aug-14 07:00,1.336234,1.637265
2024-Aug-14 08:00,0.827640,1.638524
2024-Aug-14 09:00,0.319056,1.639565
2024-Aug-14 10:00,359.810483,1.640389
2024-Aug-14 11:00,359.301920,1.640996
2024-Aug-14 12:00,358.793368,1.641385
2024-Aug-14 13:00,358.284827,1.641557
2024-Aug-14 14:00,357.776298,1.641512
2024-Aug-14 15:00,357.267779,1.641249
2024-Aug-14 16:00,356.759272,1.640770
2024-Aug-14 17:00,356.250777,1.640074
2024-Aug-14 18:00,355.742293,1.639162
2024-Aug-14 19:00,355.233820,1.638033
2024-Aug-14 20:00,354.725360,1.636688
2024-Aug-14 21:00,354.216912,1.635126
2024-Aug-14 22:00,353.708475,1.633349
2024-Aug-14 23:00,353.200051,1.631356
2024-Aug-15 00:00,352.691640,1.629147
2024-Aug-15 01:00,352.183240,1.626724
2024-Aug-15 02:00,351.674854,1.624086
2024-Aug-15 03:00,351.166480,1.621233
2024-Aug-15 04:00,350.658118,1.618166
2024-Aug-15 05:00,350.149770,1.614885
2024-Aug-15 06:00,349.641434,1.611390
2024-Aug-15 07:00,349.133112,1.607682
2024-Aug-15 08:00,348.624803,1.603762
2024-Aug-15 09:00,348.116507,1.599629
2024-Aug-15 10:00,347.608225,1.595284
2024-Aug-15 11:00,347.099956,1.590728
2024-Aug-15 12:00,346.591700,1.585961
2024-Aug-15 13:00,346.083458,1.580983
2024-Aug-15 14:00,345.575230,1.575795
2024-Aug-15 15:00,345.067016,1.570397
2024-Aug-15 16:00,344.558816,1.564790
2024-Aug-15 17:00,344.050630,1.558975
2024-Aug-15 18:00,343.542457,1.552951
2024-Aug-15 19:00,343.034299,1.546721
2024-Aug-15 20:00,342.526155,1.540283
2024-Aug-15 21:00,342.018026,1.533639
2024-Aug-15 22:00,341.509911,1.526789
2024-Aug-15 23:00,341.001810,1.519735
2024-Aug-16 00:00,340.493724,1
Loading

0 comments on commit f776c9e

Please sign in to comment.