diff --git a/isaac_sim/.pre-commit-config.yaml b/isaac_sim/.pre-commit-config.yaml new file mode 100644 index 00000000..fce68457 --- /dev/null +++ b/isaac_sim/.pre-commit-config.yaml @@ -0,0 +1,44 @@ +default_language_version: + python: python3.10 +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: check-ast + - id: check-docstring-first + - id: check-executables-have-shebangs + - id: check-shebang-scripts-are-executable + - id: check-symlinks + - id: check-toml + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks + rev: v2.13.0 + hooks: + - id: pretty-format-toml + args: ["--autofix"] + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.4.4 + hooks: + - id: ruff + args: ["--fix", "--unsafe-fixes", "--config", "ruff.toml"] + - id: ruff-format + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.10.0 + hooks: + - id: mypy + args: + [ + "--allow-subclassing-any", + "--strict", + "--ignore-missing-imports", + "--scripts-are-modules", + "--install-types", + "--non-interactive", + ] + - repo: https://github.com/AleksaC/hadolint-py + rev: v2.12.1b3 + hooks: + - id: hadolint + args: [--ignore, DL3008, --ignore, DL4006] # TODO: Pin apt-versions and remove DL3008 from ignore list diff --git a/isaac_sim/README.md b/isaac_sim/README.md new file mode 100644 index 00000000..05cd0958 --- /dev/null +++ b/isaac_sim/README.md @@ -0,0 +1,197 @@ +![space-ros_isaac-sim_front](resources/rover/repo_front.png) +# Space ROS Isaac Sim: Curiosity's Sulfur Stone Discovery in the Gediz Vallis Channel Demo + +This repository provides a Docker image for our **NASA's Curiosity rover** demo based on **NVidia Isaac Sim** that interfaces with **Space ROS**. We also built a digital twin of the **Gediz Vallis Channel Environment**, focusing on the area surrounding the recent event of **sulfur stone discovery**. The map was developed using the **HIRISE Mars DTM** (real Mars terrain data) and with custom-made rock assets that seamlessly blend into the environment. It provides a highly detailed replication of the environment for both current and future missions. As of September 2024, Curiosity is still exploring within this region. + +See [Map Documentation](./docs/maps.md) + +## Highlight of the features +- Docker image of NVIDIA Isaac Sim with Space ROS interface +- Digital twin environment of the Gediz Vallis channel sulfur stone discovery site with enhenced terrain features +- Curiosity rover asset integration into the simulation +- ROS2 interfaces for controlling the rover and sensor feedback + +## Advantages of NVidia Isaac Sim +- Realistic graphic with Ray-Tracing technology +- PhysX engine for advanced physics simulation +- Built-in DLSS Frame Generation for improved performence +- Direct VR/AR support (with extension), useful in planetory exploration simulations + +## System Requirements + +To run the Curiosity rover simulation in Isaac Sim, ensure your system meets the following requirements: + +| Requirement | Description | +| ------------ | -------------------------------------------- | +| OS | Ubuntu 22.04 | +| GPU | Nvidia RTX 30XX series or higher | +| RAM | 16 GB or higher | +| CPU | Intel i7 or higher | +| NVIDIA Driver| ver. 560.35.03 (exact ver. recommended) | + +For more detailed hardware requirements, refer to the [Isaac Sim Hardware Documentation](https://docs.omniverse.nvidia.com/isaacsim/latest/installation/requirements.html). + +## Prerequisites + +The following software dependencies must be installed on your system: + +| Dependency | Description | +| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- | +| Docker Engine | [Docker Installation Guide](https://docs.docker.com/engine/install/) | +| NVIDIA Toolkit | [NVIDIA Container Toolkit Installation](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html) | + +## Required Docker Images + +Ensure the following Docker images are built and available on your system before running the simulation: + +| Image | Description | +| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| [space-robots](https://github.com/space-ros/docker/tree/main/space_robots) | The base Docker image for space robotics research. | +| [moveit2](https://github.com/space-ros/docker/tree/main/moveit2) | Provides MoveIt2 for motion planning. | +| [space ros](https://github.com/space-ros/space-ros) | Core ROS2 components for space robotics. | + +## Building and Running the Container + +Start the Docker with +``` +sudo systemctl start docker +``` + +To build and launch the container you should cd to `docker` folder: + +To build image use this script: +```bash +./build.sh +``` + +To run docker container use this script: +```bash +./run.sh +``` +That's all you need to start the simulation environment. + +### Cloning Repositories into Docker + +The following repositories are cloned into the Docker container during the build process: + +1. **[isaac_ros2_utils](https://github.com/AlexanderRex/isaac_ros2_utils)** +2. **[curiosity_rover_description](https://github.com/AlexanderRex/curiosity_rover_description)** +3. **[mars_rover_control](https://github.com/AlexanderRex/mars_rover_control)** + +## Recommended Development Setup + +For an optimized development workflow, it is recommended to use **Visual Studio Code (VSCode)** along with its Docker-related extensions. These tools greatly simplify the process of interacting with Docker containers, especially when debugging and managing development environments. + +### Recommended VSCode Extensions: +- **[Dev Containers](https://code.visualstudio.com/docs/devcontainers/containers)**: Enables you to develop inside a Docker container. +- **[Docker Extension for VSCode](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker)**: Simplifies the management of Docker containers directly from VSCode. + +By using these tools, you can streamline your workflow and improve the experience of working within a Dockerized development environment. + +## Usage + +IMPORTANT: Before launching scripts, execute this command to attach to **space_ros_isaac_sim** container or use **VSCode remote connection**. +```bash +sudo docker exec -it space_ros_isaac_sim /bin/bash +``` + +In the first terminal, enter the Docker container(if not already) and launch Isaac Sim with one of the following two environments + +- For spawning Curiosity in the sulfur stone area in the **Gediz Vallis channel** environment + ``` + python ~/curiosity_sim/scripts/gale_crater_scene.py + ``` +- For spawning Curiosity in the **test ground** (under development) environment + ``` + python ~/curiosity_sim/scripts/test_scene.py + ``` +Note: When launching Isaac Sim for the first time it can take several minutes because of shader compilation. + + +In the second terminal, enter the Docker container and launch the control system: +```bash +ros2 launch mars_rover_control mars_rover_control.launch.py +``` + +In the third terminal, for manual control using the keyboard: +```bash +ros2 run teleop_twist_keyboard teleop_twist_keyboard +``` +Note: this terminal needs to be focused during keyboard control + +### ROS Service Commands + +In addition to ROS2 topics, the control graph supports various ROS2 service commands, allowing for precise control of different parts of the rover: + +- **Drive the rover forward**: + ```bash + ros2 service call /move_forward std_srvs/srv/Empty + ``` + +- **Stop the rover**: + ```bash + ros2 service call /move_stop std_srvs/srv/Empty + ``` + +- **Turn left**: + ```bash + ros2 service call /turn_left std_srvs/srv/Empty + ``` + +- **Turn right**: + ```bash + ros2 service call /turn_right std_srvs/srv/Empty + ``` + +- **Open the tool arm**: + ```bash + ros2 service call /open_arm std_srvs/srv/Empty + ``` + +- **Close the tool arm**: + ```bash + ros2 service call /close_arm std_srvs/srv/Empty + ``` + +- **Open the mast (camera arm)**: + ```bash + ros2 service call /mast_open std_srvs/srv/Empty + ``` + +- **Close the mast (camera arm)**: + ```bash + ros2 service call /mast_close std_srvs/srv/Empty + ``` + +### Manuevering Curiosity on a Slope +There are many hills in the Gediz Vallis channel environment. Curiosity may drift downhill on a slope and it will require increased speed to counteract the incline. + +### Recommended Render Settings for Isaac Sim + +To optimize performance and maintain high FPS in the simulation, it is recommended to adjust the render settings in **Isaac Sim** as follows: + +- **Enable DLSS**: Deep Learning Super Sampling (DLSS) is a technology that uses AI to upscale images, which can significantly boost performance without compromising visual quality. Enabling DLSS is especially useful for maintaining high FPS in complex scenes. + - For more information, refer to the [NVIDIA DLSS documentation](https://docs.omniverse.nvidia.com/materials-and-rendering/latest/rtx-renderer_rt.html#dlss). + +- **Adjust Viewport Resolution**: If your system struggles to maintain a stable FPS, reducing the resolution of the **Viewport** window can help. Lowering the viewport resolution reduces the computational load, improving performance during simulation. + - You can find more details on adjusting the viewport resolution in the [Viewport Settings documentation](https://docs.omniverse.nvidia.com/extensions/latest/ext_core/ext_viewport/controls/settings.html). + +By using these settings, you can balance visual quality with performance, ensuring smoother operation of the simulation even on lower-end systems. + + + +## Detailed Documentation + +The following table provides links to detailed documentation on various components of the **Curiosity Mars Rover** simulation, covering control, sensors, and more. + +| Document | Description | +|---------------------------|----------------------------------------------------------------------------------------------| +| [Maps](./docs/maps.md) | Information on maps and environments used in the simulation, providing context for different scenarios.| +| [Curiosity Description](./docs/curiosity_description.md) | Description and overview of the Curiosity rover model used in the simulation.| +| [Curiosity Control](./docs/curiosity_control.md) | Detailed documentation on the control system of the Curiosity rover using ROS2 and action graphs. | +| [Curiosity Sensors](./docs/curiosity_sensors.md) | Explanation of the sensors used in the simulation, including Lidar, camera, and odometry configurations. | +``` +Challenge Name: NASA Space ROS Sim Summer Sprint Challenge +Team Lead Freelancer User Name: pojenwang +Submission Title: Space-ROS-NVIDIA-Isaac-Sim Curiosity's Sulfur Stone Discovery +``` \ No newline at end of file diff --git a/isaac_sim/docker/Dockerfile b/isaac_sim/docker/Dockerfile new file mode 100644 index 00000000..96031a98 --- /dev/null +++ b/isaac_sim/docker/Dockerfile @@ -0,0 +1,82 @@ +# hadolint ignore=DL3007 +FROM osrf/space-ros:latest AS base + +# Define arguments used in the metadata definition +ARG VCS_REF +ARG VERSION="preview" + +# Specify the docker image metadata +LABEL org.label-schema.schema-version="1.0" +LABEL org.label-schema.name="Space-ROS-NVIDIA-Isaac-Sim Curiosity's Sulfur Stone Discovery" +LABEL org.label-schema.description="Repository provides a Docker image for NASA's Curiosity rover demo" +LABEL org.label-schema.vendor="Open Robotics" +LABEL org.label-schema.version=${VERSION} +LABEL org.label-schema.url="https://github.com/space-ros" +LABEL org.label-schema.vcs-url="https://github.com/space-ros/docker" +LABEL org.label-schema.vcs-ref=${VCS_REF} + +FROM base + +ENV DEBIAN_FRONTEND=noninteractive + +USER root + +COPY --link apt-requirements.txt /apt-requirements.txt +# hadolint ignore=SC2046 +RUN apt-get update && \ + apt-get install --no-install-recommends -y $(cat /apt-requirements.txt) && \ + rm -rf /var/lib/apt/lists/* +RUN rm /apt-requirements.txt + +COPY --link ros-requirements.txt /ros-requirements.txt +# hadolint ignore=SC2046 +RUN apt-get update && \ + apt-get install --no-install-recommends -y $(cat /ros-requirements.txt) && \ + rm -rf /var/lib/apt/lists/* && \ + rm /ros-requirements.txt + +RUN locale-gen en_US en_US.UTF-8 && update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 + +ENV LANG=en_US.UTF-8 + +# Install Isaac Sim +COPY --link nvidia-pip-requirements.txt /requirements.txt +RUN pip install --timeout=600 --no-cache-dir -r /requirements.txt --extra-index-url https://pypi.nvidia.com && \ + rm /requirements.txt + +RUN adduser $USERNAME sudo && echo "$USERNAME ALL=NOPASSWD: ALL" >> /etc/sudoers.d/$USERNAME + +RUN mkdir -p /usr/local/lib/python3.10/dist-packages/isaacsim/extscache/omni.gpu_foundation/cache && \ + mkdir -p /usr/local/lib/python3.10/dist-packages/omni/logs && \ + mkdir -p /usr/local/lib/python3.10/dist-packages/omni/cache/Kit/106.0/fcefe91f/PhysXLocalMeshCache && \ + mkdir -p /usr/local/lib/python3.10/dist-packages/omni/data/documents/Kit/apps/Isaac-Sim/scripts/new_stage && \ + mkdir -p /usr/local/lib/python3.10/dist-packages/omni/data/documents/Kit/shared/screenshots && \ + chown -R $USERNAME:$USERNAME /usr/local/lib/python3.10/dist-packages/isaacsim/extscache/omni.gpu_foundation/cache && \ + chown -R $USERNAME:$USERNAME /usr/local/lib/python3.10/dist-packages/omni/logs && \ + chown -R $USERNAME:$USERNAME /usr/local/lib/python3.10/dist-packages/omni/cache && \ + chown -R $USERNAME:$USERNAME /usr/local/lib/python3.10/dist-packages/omni/data/documents && \ + chmod -R 777 /usr/local/lib/python3.10/dist-packages/isaacsim/* && \ + chmod -R 777 /usr/local/lib/python3.10/dist-packages/omni/logs && \ + chmod -R 777 /usr/local/lib/python3.10/dist-packages/omni/cache && \ + chmod -R 777 /usr/local/lib/python3.10/dist-packages/omni/data/documents + +USER ${USERNAME} + +# Copy the dependency.repos +COPY --chown=${USERNAME}:${USERNAME} dependency.repos /tmp/dependency.repos + +RUN /bin/bash -c "source /opt/ros/humble/setup.bash && \ + mkdir -p /home/$USERNAME/isaac_ws/src && \ + cd /home/$USERNAME/isaac_ws && \ + vcs import src < /tmp/dependency.repos --recursive && \ + colcon build && \ + rm /tmp/dependency.repos && \ + cd /home/$USERNAME && git clone https://github.com/pojenwang/curiosity_sim.git" + +# Set environment in bashrc for future sessions +RUN echo "source /opt/ros/humble/setup.bash" >> /home/"$USERNAME"/.bashrc && \ + echo "source /home/$USERNAME/isaac_ws/install/setup.bash" >> /home/"$USERNAME"/.bashrc && \ + echo "export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp" >> /home/"$USERNAME"/.bashrc + +COPY --link entrypoint.sh /.entrypoint.sh +ENTRYPOINT ["/.entrypoint.sh"] diff --git a/isaac_sim/docker/apt-requirements.txt b/isaac_sim/docker/apt-requirements.txt new file mode 100644 index 00000000..6dceb60e --- /dev/null +++ b/isaac_sim/docker/apt-requirements.txt @@ -0,0 +1,31 @@ +apt-utils +bash-completion +build-essential +curl +debian-archive-keyring +debian-keyring +gedit +git +git-lfs +gpg-agent +libxcb-cursor0 +libxcb-xinerama0 +libxkbcommon-x11-0 +locales +lsb-release +python-is-python3 +python3 +python3-pip +python3-setuptools +software-properties-common +sudo +telnet +tree +wget +libglu1-mesa +libgl1-mesa-glx +libxrender1 +libcanberra-gtk3-0 +libpci-dev +xauth +xterm diff --git a/isaac_sim/docker/build.sh b/isaac_sim/docker/build.sh new file mode 100755 index 00000000..e65bc830 --- /dev/null +++ b/isaac_sim/docker/build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +sudo xhost + + +declare SCRIPT_NAME=$(readlink -f ${BASH_SOURCE[0]}) +cd $(dirname $SCRIPT_NAME) + +docker compose build space_ros_isaac_sim \ No newline at end of file diff --git a/isaac_sim/docker/dependency.repos b/isaac_sim/docker/dependency.repos new file mode 100644 index 00000000..c0de2c85 --- /dev/null +++ b/isaac_sim/docker/dependency.repos @@ -0,0 +1,17 @@ +repositories: + isaac_ros2_utils: + type: git + url: https://github.com/AlexanderRex/isaac_ros2_utils.git + version: main + curiosity_rover_description: + type: git + url: https://github.com/AlexanderRex/curiosity_rover_description.git + version: main + mars_rover_control: + type: git + url: https://github.com/AlexanderRex/mars_rover_control.git + version: main + ros2_controllers: + type: git + url: https://github.com/tonylitianyu/ros2_controllers.git + version: effort_group_position_controller_2 diff --git a/isaac_sim/docker/docker-compose.yml b/isaac_sim/docker/docker-compose.yml new file mode 100644 index 00000000..3306d33d --- /dev/null +++ b/isaac_sim/docker/docker-compose.yml @@ -0,0 +1,36 @@ +services: + space_ros_isaac_sim: + build: + context: . + dockerfile: Dockerfile + image: openrobotics/space_ros_isaac_sim + container_name: space_ros_isaac_sim + network_mode: host + runtime: nvidia + privileged: true + environment: + - DISPLAY + - QT_X11_NO_MITSHM=1 + - XAUTHORITY=/tmp/.docker.xauth + - OMNI_KIT_ACCEPT_EULA=Y + - ACCEPT_EULA=Y + - PRIVACY_CONSENT=Y + - XDG_RUNTIME_DIR=/run/user/1000 + - NVIDIA_VISIBLE_DEVICES=all + - NVIDIA_DRIVER_CAPABILITIES=all + volumes: + - /tmp/.X11-unix:/tmp/.X11-unix:rw + - /tmp/.docker.xauth:/tmp/.docker.xauth + - isaac-cache:/home/spaceros-user/.isaac-sim-cache:rw + - ../lidar_configs/CuriosityLidar.json:/usr/local/lib/python3.10/dist-packages/isaacsim/exts/omni.isaac.sensor/data/lidar_configs/CuriosityLidar.json:ro + devices: + - /dev/dri:/dev/dri + deploy: + resources: + reservations: + devices: + - driver: nvidia + count: 1 + capabilities: [gpu] +volumes: + isaac-cache: diff --git a/isaac_sim/docker/entrypoint.sh b/isaac_sim/docker/entrypoint.sh new file mode 100755 index 00000000..9069e115 --- /dev/null +++ b/isaac_sim/docker/entrypoint.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +sudo chown spaceros-user ~/.isaac-sim-cache -R +bash diff --git a/isaac_sim/docker/nvidia-pip-requirements.txt b/isaac_sim/docker/nvidia-pip-requirements.txt new file mode 100644 index 00000000..20c5946e --- /dev/null +++ b/isaac_sim/docker/nvidia-pip-requirements.txt @@ -0,0 +1,4 @@ +isaacsim==4.1.0.0 +isaacsim-extscache-kit==4.1.0.0 +isaacsim-extscache-kit-sdk==4.1.0.0 +isaacsim-extscache-physics==4.1.0.0 diff --git a/isaac_sim/docker/ros-requirements.txt b/isaac_sim/docker/ros-requirements.txt new file mode 100644 index 00000000..7d9bb661 --- /dev/null +++ b/isaac_sim/docker/ros-requirements.txt @@ -0,0 +1,11 @@ +python3-colcon-common-extensions +python3-rosdep +ros-humble-desktop +ros-humble-controller-manager +ros-humble-xacro +ros-humble-vision-msgs +ros-humble-rmw-cyclonedds-cpp +ros-humble-teleop-twist-keyboard +ros-humble-angles +ros-humble-ros2-control +ros-humble-ros2-controllers diff --git a/isaac_sim/docker/run.sh b/isaac_sim/docker/run.sh new file mode 100755 index 00000000..4aa182ea --- /dev/null +++ b/isaac_sim/docker/run.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +sudo xhost + + +declare SCRIPT_NAME=$(readlink -f ${BASH_SOURCE[0]}) +cd $(dirname $SCRIPT_NAME) + +docker compose run --name space_ros_isaac_sim --rm space_ros_isaac_sim --remove-orphans diff --git a/isaac_sim/docs/curiosity_control.md b/isaac_sim/docs/curiosity_control.md new file mode 100644 index 00000000..27db1db6 --- /dev/null +++ b/isaac_sim/docs/curiosity_control.md @@ -0,0 +1,28 @@ + +## Control Graph for Curiosity Mars Rover + +The **Curiosity Mars Rover** is controlled using a combination of the **[ROS2 topic-based control plugin](https://github.com/PickNikRobotics/topic_based_ros2_control)** and an action graph specifically designed for managing the rover's components such as wheels, mast arm, and tool arm. This graph has been generated with help of this **[isaac_ros2_utils](https://github.com/hijimasa/isaac_ros2_utils)** package. Control system allows for seamless real-time control of the rover through ROS2 messages. + + +

+ Control Graph +

+ +### ROS Topics for Control + +Once the control graph is running, the following ROS2 topics are available for controlling the rover: + +| Topic | Description | +|-------------------------------------------------|-----------------------------------------------------------------------------| +| `/cmd_vel` | Controls the rover's linear and angular velocity. | +| `/curiosity_mars_rover/joint_command` | Sends joint control commands for the articulated components of the rover. | +| `/curiosity_mars_rover/joint_states` | Publishes the current state (positions, velocities) of the rover's joints. | +| `/arm_joint_trajectory_controller/joint_trajectory` | Commands the tool arm’s movement along a defined trajectory. | +| `/arm_joint_trajectory_controller/state` | Provides the current state of the tool arm trajectory controller. | +| `/mast_joint_trajectory_controller/joint_trajectory`| Commands the mast arm’s movement along a defined trajectory. | +| `/mast_joint_trajectory_controller/state` |Provides the current state of the mast arm trajectory controller. | +| `/dynamic_joint_states` |Publishes dynamic states of the rover’s joints (position, effort, velocity).| +| `/joint_states` | Provides the current state of all joints (positions, velocities, efforts). | +| `/steer_position_controller/joint_trajectory` | Controls the steering of the rover's wheels. | +| `/wheel_tree_position_controller/commands` | Sends position commands to the wheel controllers. | +| `/wheel_velocity_controller/commands` | Sends velocity commands to the wheel controllers. | \ No newline at end of file diff --git a/isaac_sim/docs/curiosity_description.md b/isaac_sim/docs/curiosity_description.md new file mode 100644 index 00000000..c5b0e655 --- /dev/null +++ b/isaac_sim/docs/curiosity_description.md @@ -0,0 +1,51 @@ + +# Curiosity Mars Rover + +![Curiosity Mars Rover](../resources/rover/rover.png) + +The **Curiosity rover** is a car-sized robotic explorer that was launched by NASA in 2011 as part of the Mars Science Laboratory mission. Its primary mission is to investigate the climate and geology of Mars, particularly in the Gale Crater. Curiosity has been exploring the Martian surface since its landing in 2012, conducting experiments to determine whether Mars has ever had the conditions to support life. Equipped with advanced scientific instruments, Curiosity analyzes soil, rock samples, and the atmosphere, transmitting valuable data back to Earth. Its discoveries have helped scientists better understand the history of water on Mars and its potential to harbor life. + +For more information, visit the official [NASA Curiosity Mars Rover mission page](https://science.nasa.gov/mission/msl-curiosity/). + +### Model Overview + +The **Curiosity rover** model used in this simulation is based on the original model from the [space-ros/simulation repository](https://github.com/space-ros/simulation). The original structure of the model has been preserved, with several modifications and enhancements added to optimize the rover's performance in the IsaacSim environment. + +Key modifications include: + +- **Drivers for joints**: Added control drivers for the rover's joints, allowing them to be controlled via ROS2. +- **Damping, stiffness, and joint friction**: Parameters were adjusted to ensure smooth and realistic movement of the rover, particularly for driving over rough terrain. +- **Spherical collision for wheels**: A spherical collision model was added to the wheels to optimize resource usage and ensure smooth traversal of complex landscapes. +- **Sensors**: All sensors, including the camera and lidar, were transferred with their original configurations from the URDF file to ensure accurate sensor performance in the simulation. + +The model can be found in the project at the following path relative to the root folder: + +``` +/home/spaceros-user/curiosity_sim/models/curiosity_mars_rover/curiosity_mars_rover.usd +``` + +### Action Graphs + +Several action graphs are used in the simulation to control different components of the rover and publish sensor data. These graphs are automatically generated when running Python scripts that open the corresponding simulation scenes and include: + +1. **RobotControlGraph**: Manages the rover’s joints and sends control commands via ROS2. +2. **CameraGraph**: Controls the mast camera and publishes image data through ROS2. +3. **ClockGraph**: Publishes simulation time to the `/clock` ROS2 topic for synchronization. +4. **OdometryGraph**: Computes and publishes the rover’s odometry and transformations through ROS2. +5. **LidarGraph**: Processes and publishes data from the lidar sensor via ROS2. + +### Available ROS Topics + +When the simulation is running, the following ROS topics are available: + +| Topic | Message Type | Description | +|--------------------------------------------|-----------------------------|-----------------------------------------------------------------------------| +| `/clock` | `rosgraph_msgs/Clock` | Publishes the simulation time to synchronize with ROS nodes. | +| `/curiosity_mars_rover/joint_command` | `sensor_msgs/JointState` | Receives joint control commands to manipulate the rover's joints. | +| `/curiosity_mars_rover/joint_states` | `sensor_msgs/JointState` | Publishes the current states (position, velocity) of all the rover’s joints.| +| `/image_raw` | `sensor_msgs/Image` | Provides the raw RGB image feed from the rover's camera. | +| `/model/curiosity_mars_rover/odometry` | `nav_msgs/Odometry` | Publishes odometry data, including the rover's position and velocity. | +| `/scan` | `sensor_msgs/LaserScan` | Publishes lidar scan data to represent the rover's surrounding environment. | +| `/tf` | `tf2_msgs/TFMessage` | Provides the transformation between different coordinate frames of the rover.| + +These topics allow you to control the rover, access sensor data, and monitor the simulation. \ No newline at end of file diff --git a/isaac_sim/docs/curiosity_sensors.md b/isaac_sim/docs/curiosity_sensors.md new file mode 100644 index 00000000..85a6fdcb --- /dev/null +++ b/isaac_sim/docs/curiosity_sensors.md @@ -0,0 +1,51 @@ + +## Sensor Graphs for Curiosity Mars Rover + +The **Curiosity Mars Rover** simulation includes several sensor setups, each managed by a specific ROS2 action graph. These sensors provide essential data such as the rover's position, orientation, and surrounding environment. The main sensor graphs are responsible for publishing TF, odometry, RGB camera data, and lidar data. The configurations for these sensors, including their positions and orientations, are derived from the original URDF file found in the [simulation repository](https://github.com/space-ros/simulation/tree/main/models/curiosity_path/urdf) + +### TF and Odometry Publisher + +This action graph is responsible for publishing both the **TF** (transformation) and **odometry** data. The graph reads the current position and orientation of the rover and publishes these values to the ROS2 network. The TF data is crucial for defining the relative positions of the rover's parts, while the odometry data provides information on the rover's movement over time. + +

+ TF and Odometry Publisher +

+ +The configuration of the TF and odometry publishers is based on the data extracted from the URDF file. This ensures accurate and realistic simulation of the rover's position and movement within the environment. + +If you need additional info about this part check [ROS2 Transform Trees and Odometry](https://docs.omniverse.nvidia.com/isaacsim/latest/ros2_tutorials/tutorial_ros2_tf.html) + +### RGB Camera Publisher + +This graph handles the **RGB camera** mounted on the rover's mast. The camera provides image data, which is published to the ROS2 network as an RGB image. This data can be used for tasks like computer vision, environment analysis, and remote monitoring. + +

+ RGB Camera Publisher +

+ +The placement and field of view for the camera are configured according to the URDF file. The camera graph captures frames from the simulation and publishes them as **sensor_msgs/Image** messages, allowing for further processing by ROS2 nodes. + +For more information on setting up and using ROS2 cameras in IsaacSim, refer to the following guide: +[ROS2 Camera Tutorial - IsaacSim](https://docs.omniverse.nvidia.com/isaacsim/latest/ros2_tutorials/tutorial_ros2_camera.html#isaac-sim-app-tutorial-ros2-camera) + +### 2D Lidar Publisher + +The **2D lidar** action graph is responsible for publishing point cloud data from the lidar sensor. Lidar is essential for mapping the rover's environment and detecting obstacles. The lidar configuration is imported through a **Docker volume** into the container and placed in the following path: + +``` +/usr/local/lib/python3.10/dist-packages/isaacsim/exts/omni.isaac.sensor/data/lidar_configs/CuriosityLidar.json +``` + +This file contains the specifications and settings for the Curiosity Rover's 2D lidar sensor. + +

+ Lidar Publisher +

+ +The 2D lidar sensor emits laser beams and collects data about distances to surrounding objects. This data is published in ROS2 **sensor_msgs/LaserScan** for use in mapping and obstacle detection. Config can be finded in this [folder](../lidar_configs/CuriosityLidar.json). + +Also you can use this [script](../scripts/lidar_emmiters_gen.py) for your own config generation. + +For more details on configuring and using RTX-based lidar in IsaacSim, check out these links: +- [RTX Lidar Tutorial - IsaacSim](https://docs.omniverse.nvidia.com/isaacsim/latest/ros2_tutorials/tutorial_ros2_rtx_lidar.html) +- [Lidar Configuration Guide - IsaacSim](https://docs.omniverse.nvidia.com/isaacsim/latest/features/sensors_simulation/isaac_sim_sensors_rtx_based_lidar/lidar_config.html) \ No newline at end of file diff --git a/isaac_sim/docs/maps.md b/isaac_sim/docs/maps.md new file mode 100644 index 00000000..6c646355 --- /dev/null +++ b/isaac_sim/docs/maps.md @@ -0,0 +1,46 @@ +# Mars: Gale Crater - Gediz Vallis Channel Environment + +## Curiosity's Sulfur Stone Discovery + +NASA's Curiosity rover made a groundbreaking discovery on May 30, 2024 while exploring the Gediz Vallis channel within Gale Crater. Curiosity drove over and cracked open a white/yellow stone revealing it is made of pure-sulfer crystal. This is the first instance of elemental sulfur stone found on Mars. Curiosity encountered large fields of these bright stones. It drilled its #41 hole on a rock and took a 360-degree panoramic photo of the surrounding area. + +See [NASA JPL's original post](https://www.jpl.nasa.gov/news/nasas-curiosity-rover-discovers-a-surprise-in-a-martian-rock) from July 31, 2024 for full-story. + +Click on the image below to see the 360-degree panoramic photo taken by Curiosity (source: same post from above). + +[![360-degree panoramic photo](https://img.youtube.com/vi/1cqc_Cr_prc/hqdefault.jpg)](https://www.youtube.com/watch?v=1cqc_Cr_prc) + +## Digital Twin of Gediz Vallis Channel Environment + +Using the 360-degree panoramic photo, [Curiosity's current location and trajectory](https://science.nasa.gov/mission/msl-curiosity/location-map/), and the [HIRISE Gediz Vallis Channel DTM](https://www.uahirise.org/dtm/dtm.php?ID=PSP_009149_1750), we successfully pinpointed Curiosity’s first sulfur stone discovery location within the DTM. To commemorate this historic discovery, we created a digital twin of the Gediz Vallis Channel, with a focus on accurately recreating the environment surrounding the sulfur stone discovery site. + +

+ sim_to_real +

+ +## Map Setup + +The original Gediz Vallis Channel map from DTM dataset spans approximately 5.65 km in width and 14 km in length, with a resolution of 1.01 meters per post. Using the entire map at the native resolution is too resource-intensive. As a result, the outer sections of the map were cropped to exclude areas too far from Curiosity's current location. The remaining region was divided into two sections: a high-resolution inner region, centered on the sulfur stone discovery site, with 60% of the original resolution (2.02 meters per post), and a low-resolution outer region at 10% of the original resolution, primarily serving as a background. The terrain's texture map were colorized to the generaic Mars color, upscaled, and post-processed to enhance detail. Certain parts of the terrain meshes, such as sand dunes or cliffs, were edited to enhence their geographic features. + +

+ map_resolution_regions +

+ +## Environment Color + +The terrain texture was colorized to the typical color of Mars. If you would like to alter the overall color theme of the environment (such as making it more red or yellow), it can be done by adjusting the distant light color in Isaac Sim without changing the terrain texture itself. + +## Rocks + +There are many different types of rock on Mars. Using the 360-degree panoramic photo taken at the sulfur stone discovery site and other publicly available Mars photos as references, we custom-designed two distinct types of rock assets: white/yellow sulfur stones and black volcanic rocks. Each rock type has unique characteristics: + +- **Sulfur Stones**: Small, white/yellow rocks with surface holes +- **Volcanic Rocks**: Black, partially dust-covered stones + +

+ rocks +

+ +A total of 24 variations of sulfur stones and 20 variations of volcanic rocks were generated. The sulfur stones were made to be very low poly due to the large number being spawned. The rocks' shapes, materials, and textures were made to retain their unique properties. They were placed according to real-world reference photo, with randomized sizes and orientations. More type of rocks will be added in the future. + +Most of the rocks in the Gediz Vallis Channel environment has collision enabled, allowing them to interact with Curiosity's wheels. However, some of the very smaller rocks do not have collision enabled, allowing the wheels to pass through them. \ No newline at end of file diff --git a/isaac_sim/lidar_configs/CuriosityLidar.json b/isaac_sim/lidar_configs/CuriosityLidar.json new file mode 100644 index 00000000..efaf606e --- /dev/null +++ b/isaac_sim/lidar_configs/CuriosityLidar.json @@ -0,0 +1,44 @@ +{ + "class": "sensor", + "type": "lidar", + "name": "CuriosityLidar", + "driveWorksId": "GENERIC", + "profile": { + "scanType": "rotary", + "intensityProcessing": "normalization", + "rotationDirection": "CW", + "rayType": "IDEALIZED", + "nearRangeM": 1.0, + "farRangeM": 20.0, + "rangeResolutionM": 0.05, + "rangeAccuracyM": 0.04, + "avgPowerW": 3.6, + "wavelengthNm": 905.0, + "pulseTimeNs": 23, + "maxReturns": 1, + "reportRateBaseHz": 32000, + "scanRateBaseHz": 10.0, + "numberOfEmitters": 640, + "startAzimuthDeg": -180, + "endAzimuthDeg": 180, + "upElevationDeg": 0, + "downElevationDeg": 0, + "effectiveApertureSize": 0.0145, + "focusDistM": 0.05, + "intensityMappingType": "LINEAR", + "minReflectance": 0.1, + "minReflectanceRange": 10.0, + "azimuthErrorMean": 0.0, + "azimuthErrorStd": 0.0, + "elevationErrorMean": 0.0, + "elevationErrorStd": 0.0, + "emitterStateCount": 1, + "emitterStates": [ + { + "azimuthDeg": [180.0, 179.43661971830986, 178.8732394366197, 178.30985915492957, 177.74647887323943, 177.18309859154928, 176.61971830985917, 176.05633802816902, 175.49295774647888, 174.92957746478874, 174.3661971830986, 173.80281690140845, 173.2394366197183, 172.67605633802816, 172.11267605633802, 171.54929577464787, 170.98591549295776, 170.42253521126761, 169.85915492957747, 169.29577464788733, 168.73239436619718, 168.16901408450704, 167.6056338028169, 167.04225352112675, 166.4788732394366, 165.91549295774647, 165.35211267605635, 164.7887323943662, 164.22535211267606, 163.66197183098592, 163.09859154929578, 162.53521126760563, 161.9718309859155, 161.40845070422534, 160.8450704225352, 160.28169014084506, 159.71830985915494, 159.1549295774648, 158.59154929577466, 158.0281690140845, 157.46478873239437, 156.90140845070422, 156.33802816901408, 155.77464788732394, 155.2112676056338, 154.64788732394365, 154.0845070422535, 153.5211267605634, 152.95774647887325, 152.3943661971831, 151.83098591549296, 151.26760563380282, 150.70422535211267, 150.14084507042253, 149.57746478873239, 149.01408450704224, 148.45070422535213, 147.88732394366195, 147.32394366197184, 146.7605633802817, 146.19718309859155, 145.6338028169014, 145.07042253521126, 144.50704225352112, 143.94366197183098, 143.38028169014083, 142.8169014084507, 142.25352112676057, 141.69014084507043, 141.1267605633803, 140.56338028169014, 140.0, 139.43661971830986, 138.8732394366197, 138.30985915492957, 137.74647887323943, 137.1830985915493, 136.61971830985914, 136.05633802816902, 135.49295774647888, 134.92957746478874, 134.3661971830986, 133.80281690140845, 133.2394366197183, 132.67605633802816, 132.11267605633802, 131.54929577464787, 130.98591549295776, 130.4225352112676, 129.85915492957747, 129.29577464788733, 128.73239436619718, 128.16901408450704, 127.6056338028169, 127.04225352112675, 126.47887323943661, 125.91549295774648, 125.35211267605634, 124.78873239436619, 124.22535211267606, 123.66197183098592, 123.09859154929578, 122.53521126760563, 121.97183098591549, 121.40845070422534, 120.8450704225352, 120.28169014084506, 119.71830985915493, 119.15492957746478, 118.59154929577466, 118.02816901408451, 117.46478873239437, 116.90140845070422, 116.33802816901408, 115.77464788732394, 115.2112676056338, 114.64788732394366, 114.08450704225352, 113.52112676056338, 112.95774647887323, 112.39436619718309, 111.83098591549296, 111.26760563380282, 110.70422535211267, 110.14084507042253, 109.57746478873239, 109.01408450704226, 108.45070422535211, 107.88732394366197, 107.32394366197182, 106.76056338028168, 106.19718309859155, 105.63380281690141, 105.07042253521126, 104.50704225352112, 103.94366197183098, 103.38028169014085, 102.8169014084507, 102.25352112676056, 101.69014084507042, 101.12676056338027, 100.56338028169014, 100.0, 99.43661971830986, 98.87323943661971, 98.30985915492957, 97.74647887323944, 97.1830985915493, 96.61971830985915, 96.05633802816901, 95.49295774647887, 94.92957746478872, 94.36619718309859, 93.80281690140845, 93.2394366197183, 92.67605633802816, 92.11267605633802, 91.54929577464789, 90.98591549295774, 90.4225352112676, 89.85915492957746, 89.29577464788731, 88.73239436619718, 88.16901408450704, 87.6056338028169, 87.04225352112675, 86.47887323943661, 85.91549295774648, 85.35211267605634, 84.78873239436619, 84.22535211267605, 83.6619718309859, 83.09859154929578, 82.53521126760563, 81.97183098591549, 81.40845070422534, 80.8450704225352, 80.28169014084507, 79.71830985915493, 79.15492957746478, 78.59154929577464, 78.0281690140845, 77.46478873239437, 76.90140845070422, 76.33802816901408, 75.77464788732394, 75.2112676056338, 74.64788732394366, 74.08450704225352, 73.52112676056338, 72.95774647887323, 72.39436619718309, 71.83098591549296, 71.26760563380282, 70.70422535211267, 70.14084507042253, 69.57746478873239, 69.01408450704224, 68.45070422535211, 67.88732394366197, 67.32394366197182, 66.76056338028168, 66.19718309859154, 65.63380281690141, 65.07042253521126, 64.50704225352112, 63.94366197183098, 63.38028169014083, 62.816901408450704, 62.25352112676056, 61.69014084507042, 61.12676056338027, 60.56338028169013, 60.0, 59.436619718309856, 58.87323943661971, 58.30985915492957, 57.746478873239425, 57.183098591549296, 56.61971830985915, 56.05633802816901, 55.492957746478865, 54.92957746478872, 54.36619718309859, 53.80281690140845, 53.239436619718305, 52.67605633802816, 52.11267605633802, 51.549295774647874, 50.98591549295773, 50.422535211267586, 49.85915492957747, 49.29577464788733, 48.732394366197184, 48.16901408450704, 47.6056338028169, 47.04225352112675, 46.47887323943661, 45.915492957746466, 45.35211267605632, 44.78873239436618, 44.22535211267606, 43.66197183098592, 43.098591549295776, 42.53521126760563, 41.97183098591549, 41.408450704225345, 40.8450704225352, 40.28169014084506, 39.718309859154914, 39.15492957746477, 38.591549295774655, 38.02816901408451, 37.46478873239437, 36.901408450704224, 36.33802816901408, 35.77464788732394, 35.21126760563379, 34.64788732394365, 34.084507042253506, 33.52112676056336, 32.95774647887322, 32.3943661971831, 31.83098591549296, 31.267605633802816, 30.704225352112672, 30.14084507042253, 29.577464788732385, 29.01408450704224, 28.450704225352098, 27.887323943661954, 27.32394366197181, 26.760563380281695, 26.19718309859155, 25.633802816901408, 25.070422535211264, 24.50704225352112, 23.943661971830977, 23.380281690140833, 22.81690140845069, 22.253521126760546, 21.690140845070403, 21.126760563380287, 20.563380281690144, 20.0, 19.436619718309856, 18.873239436619713, 18.30985915492957, 17.746478873239425, 17.18309859154928, 16.619718309859138, 16.056338028168994, 15.49295774647888, 14.929577464788736, 14.366197183098592, 13.802816901408448, 13.239436619718305, 12.676056338028161, 12.112676056338017, 11.549295774647874, 10.98591549295773, 10.422535211267586, 9.859154929577443, 9.295774647887328, 8.732394366197184, 8.16901408450704, 7.605633802816897, 7.042253521126753, 6.478873239436609, 5.915492957746466, 5.352112676056322, 4.788732394366178, 4.225352112676035, 3.6619718309859195, 3.098591549295776, 2.535211267605632, 1.9718309859154886, 1.408450704225345, 0.8450704225352013, 0.2816901408450576, -0.28169014084508603, -0.8450704225352297, -1.4084507042253733, -1.9718309859154886, -2.535211267605632, -3.098591549295776, -3.6619718309859195, -4.225352112676063, -4.788732394366207, -5.35211267605635, -5.915492957746494, -6.478873239436638, -7.042253521126781, -7.605633802816897, -8.16901408450704, -8.732394366197184, -9.295774647887328, -9.859154929577471, -10.422535211267615, -10.985915492957758, -11.549295774647902, -12.112676056338046, -12.67605633802819, -13.239436619718333, -13.802816901408448, -14.366197183098592, -14.929577464788736, -15.49295774647888, -16.056338028169023, -16.619718309859167, -17.18309859154931, -17.746478873239454, -18.309859154929597, -18.87323943661974, -19.436619718309856, -20.0, -20.563380281690144, -21.126760563380287, -21.69014084507043, -22.253521126760575, -22.81690140845072, -23.380281690140862, -23.943661971831006, -24.50704225352115, -25.070422535211264, -25.633802816901408, -26.19718309859155, -26.760563380281695, -27.32394366197184, -27.887323943661983, -28.450704225352126, -29.01408450704227, -29.577464788732414, -30.140845070422557, -30.704225352112672, -31.267605633802816, -31.83098591549296, -32.3943661971831, -32.95774647887325, -33.52112676056339, -34.084507042253534, -34.64788732394368, -35.21126760563382, -35.774647887323965, -36.33802816901408, -36.901408450704224, -37.46478873239437, -38.02816901408451, -38.591549295774655, -39.1549295774648, -39.71830985915494, -40.281690140845086, -40.84507042253523, -41.40845070422537, -41.97183098591552, -42.53521126760563, -43.098591549295776, -43.66197183098592, -44.22535211267606, -44.78873239436621, -45.35211267605635, -45.915492957746494, -46.47887323943664, -47.04225352112678, -47.605633802816925, -48.16901408450704, -48.732394366197184, -49.29577464788733, -49.85915492957747, -50.422535211267615, -50.98591549295776, -51.5492957746479, -52.112676056338046, -52.67605633802819, -53.23943661971833, -53.80281690140845, -54.36619718309859, -54.929577464788736, -55.49295774647888, -56.05633802816902, -56.61971830985917, -57.18309859154931, -57.746478873239454, -58.3098591549296, -58.87323943661974, -59.436619718309856, -60.0, -60.563380281690144, -61.12676056338029, -61.69014084507043, -62.253521126760575, -62.81690140845072, -63.38028169014086, -63.943661971831006, -64.50704225352115, -65.07042253521129, -65.63380281690141, -66.19718309859155, -66.7605633802817, -67.32394366197184, -67.88732394366198, -68.45070422535213, -69.01408450704227, -69.57746478873241, -70.14084507042256, -70.7042253521127, -71.26760563380282, -71.83098591549296, -72.3943661971831, -72.95774647887325, -73.52112676056339, -74.08450704225353, -74.64788732394368, -75.21126760563382, -75.77464788732397, -76.33802816901408, -76.90140845070425, -77.46478873239437, -78.02816901408454, -78.59154929577466, -79.15492957746483, -79.71830985915494, -80.28169014084506, -80.84507042253523, -81.40845070422534, -81.97183098591552, -82.53521126760563, -83.0985915492958, -83.66197183098592, -84.22535211267609, -84.7887323943662, -85.35211267605638, -85.9154929577465, -86.47887323943661, -87.04225352112678, -87.6056338028169, -88.16901408450707, -88.73239436619718, -89.29577464788736, -89.85915492957747, -90.42253521126764, -90.98591549295776, -91.54929577464787, -92.11267605633805, -92.67605633802816, -93.23943661971833, -93.80281690140845, -94.36619718309862, -94.92957746478874, -95.49295774647891, -96.05633802816902, -96.6197183098592, -97.18309859154931, -97.74647887323943, -98.3098591549296, -98.87323943661971, -99.43661971830988, -100.0, -100.56338028169017, -101.12676056338029, -101.69014084507046, -102.25352112676057, -102.81690140845069, -103.38028169014086, -103.94366197183098, -104.50704225352115, -105.07042253521126, -105.63380281690144, -106.19718309859155, -106.76056338028172, -107.32394366197184, -107.88732394366201, -108.45070422535213, -109.01408450704224, -109.57746478873241, -110.14084507042253, -110.7042253521127, -111.26760563380282, -111.83098591549299, -112.3943661971831, -112.95774647887328, -113.52112676056339, -114.08450704225356, -114.64788732394368, -115.2112676056338, -115.77464788732397, -116.33802816901408, -116.90140845070425, -117.46478873239437, -118.02816901408454, -118.59154929577466, -119.15492957746483, -119.71830985915494, -120.28169014084506, -120.84507042253523, -121.40845070422534, -121.97183098591552, -122.53521126760563, -123.0985915492958, -123.66197183098592, -124.22535211267609, -124.7887323943662, -125.35211267605638, -125.9154929577465, -126.47887323943661, -127.04225352112678, -127.6056338028169, -128.16901408450707, -128.73239436619718, -129.29577464788736, -129.85915492957747, -130.42253521126764, -130.98591549295776, -131.54929577464787, -132.11267605633805, -132.67605633802816, -133.23943661971833, -133.80281690140845, -134.36619718309862, -134.92957746478874, -135.4929577464789, -136.05633802816902, -136.6197183098592, -137.1830985915493, -137.74647887323943, -138.3098591549296, -138.8732394366197, -139.43661971830988, -140.0, -140.56338028169017, -141.1267605633803, -141.69014084507046, -142.25352112676057, -142.81690140845075, -143.38028169014086, -143.94366197183098, -144.50704225352115, -145.07042253521126, -145.63380281690144, -146.19718309859155, -146.76056338028172, -147.32394366197184, -147.887323943662, -148.45070422535213, -149.01408450704224, -149.5774647887324, -150.14084507042253, -150.7042253521127, -151.26760563380282, -151.830985915493, -152.3943661971831, -152.95774647887328, -153.5211267605634, -154.08450704225356, -154.64788732394368, -155.2112676056338, -155.77464788732397, -156.33802816901408, -156.90140845070425, -157.46478873239437, -158.02816901408454, -158.59154929577466, -159.15492957746483, -159.71830985915494, -160.28169014084511, -160.84507042253523, -161.40845070422534, -161.97183098591552, -162.53521126760563, -163.0985915492958, -163.66197183098592, -164.2253521126761, -164.7887323943662, -165.35211267605638, -165.9154929577465, -166.4788732394366, -167.04225352112678, -167.6056338028169, -168.16901408450707, -168.73239436619718, -169.29577464788736, -169.85915492957747, -170.42253521126764, -170.98591549295776, -171.54929577464793, -172.11267605633805, -172.67605633802816, -173.23943661971833, -173.80281690140845, -174.36619718309862, -174.92957746478874, -175.4929577464789, -176.05633802816902, -176.6197183098592, -177.1830985915493, -177.74647887323943, -178.3098591549296, -178.8732394366197, -179.43661971830988, -180.0], + "elevationDeg": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + } + ] + } +} diff --git a/isaac_sim/resources/action_graphs/control_graph.png b/isaac_sim/resources/action_graphs/control_graph.png new file mode 100644 index 00000000..19cce887 Binary files /dev/null and b/isaac_sim/resources/action_graphs/control_graph.png differ diff --git a/isaac_sim/resources/maps/map_resolution_regions_s.png b/isaac_sim/resources/maps/map_resolution_regions_s.png new file mode 100644 index 00000000..8cadbede Binary files /dev/null and b/isaac_sim/resources/maps/map_resolution_regions_s.png differ diff --git a/isaac_sim/resources/maps/rocks.png b/isaac_sim/resources/maps/rocks.png new file mode 100644 index 00000000..93484392 Binary files /dev/null and b/isaac_sim/resources/maps/rocks.png differ diff --git a/isaac_sim/resources/maps/sim_to_real.png b/isaac_sim/resources/maps/sim_to_real.png new file mode 100644 index 00000000..18015bdd Binary files /dev/null and b/isaac_sim/resources/maps/sim_to_real.png differ diff --git a/isaac_sim/resources/rover/repo_front.png b/isaac_sim/resources/rover/repo_front.png new file mode 100644 index 00000000..804fc43d Binary files /dev/null and b/isaac_sim/resources/rover/repo_front.png differ diff --git a/isaac_sim/resources/rover/rover.png b/isaac_sim/resources/rover/rover.png new file mode 100644 index 00000000..6930f588 Binary files /dev/null and b/isaac_sim/resources/rover/rover.png differ diff --git a/isaac_sim/resources/sensors/camera.png b/isaac_sim/resources/sensors/camera.png new file mode 100644 index 00000000..8670dd95 Binary files /dev/null and b/isaac_sim/resources/sensors/camera.png differ diff --git a/isaac_sim/resources/sensors/lidar.png b/isaac_sim/resources/sensors/lidar.png new file mode 100644 index 00000000..efe89790 Binary files /dev/null and b/isaac_sim/resources/sensors/lidar.png differ diff --git a/isaac_sim/resources/sensors/tf_odometry.png b/isaac_sim/resources/sensors/tf_odometry.png new file mode 100644 index 00000000..ba2f1c61 Binary files /dev/null and b/isaac_sim/resources/sensors/tf_odometry.png differ diff --git a/isaac_sim/ruff.toml b/isaac_sim/ruff.toml new file mode 100644 index 00000000..487a5011 --- /dev/null +++ b/isaac_sim/ruff.toml @@ -0,0 +1,22 @@ +indent-width = 4 +line-length = 120 +target-version = "py310" + +[lint] +# Matches _, __, and _var but not _var_ +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" +fixable = ["ALL"] +ignore = [ + "D100", + "D203", + "D213", + "D400", + "D401", + "D415", + "PLR0912", + "PLR0913", + "PLR0915", + "RUF012" +] +select = ["E", "W", "F", "I", "B", "D", "RET", "RUF", "PL", "PIE", "FLY"] +unfixable = [] diff --git a/isaac_sim/scripts/lidar_emmiters_gen.py b/isaac_sim/scripts/lidar_emmiters_gen.py new file mode 100644 index 00000000..aadb5cda --- /dev/null +++ b/isaac_sim/scripts/lidar_emmiters_gen.py @@ -0,0 +1,41 @@ +""" +This script generates parameters for a lidar sensor, such as azimuthDeg, elevationDeg, +and fireTimeNs. The number of emitters and the angular range are configurable, and the +values are printed in a format suitable for JSON. +""" + +import numpy as np + +# Constants +NUM_EMITTERS = 640 # Number of emitters + +# Generate 640 azimuth values ranging from 180 to -180 degrees +azimuth_deg = np.linspace(180, -180, NUM_EMITTERS).tolist() + +# All elevationDeg values are set to 0 +elevation_deg = [0] * NUM_EMITTERS + +# All fireTimeNs values are set to 0 +fire_time_ns = [0] * NUM_EMITTERS + + +def print_parameter(name, values, is_last=False): + """ + Prints the provided parameter name and its values in the format: + "name": [value1, value2, ..., valueN], or without a comma if it's the last parameter. + + Args: + name (str): The name of the parameter. + values (list): A list of values to be printed for the parameter. + is_last (bool): If True, no comma will be added at the end. + """ + formatted_values = ", ".join(map(str, values)) # Joining the list with commas + if is_last: + print(f'"{name}": [{formatted_values}]') # No comma after the closing bracket + else: + print(f'"{name}": [{formatted_values}],') # Add comma after the closing bracket + +# Print azimuthDeg, elevationDeg with commas, and fireTimeNs without +print_parameter("azimuthDeg", azimuth_deg) +print_parameter("elevationDeg", elevation_deg) +print_parameter("fireTimeNs", fire_time_ns, is_last=True)