Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NASA_Challenge_[Barisyaz]_[Ingenuity Flight Simulator] #39

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

BarisYazici
Copy link

@BarisYazici BarisYazici commented Sep 4, 2024

This project simulates the Ingenuity Mars Helicopter using Gazebo and ROS 2 in Space-ROS.

closes #67

Aim of this project is to develop tools to mimic the Martian environment as close as possible. This enables space robots to easily iterate over the development cycles. This is important especially for the aerial vehicles. Because the air is much thinner and the nature events are different. Having this in mind, I develop the Ingenuity Flight Simulator, calculating the lift and drag forces as close to the Martian atmosphere and gravity as possible. This could enable Nasa engineers to develop controllers that can react to the nature events or test flight controllers with sensor noise such as IMU, altimeter or Camera.

landing_e27e4Hjz.mp4
cyclic_Bx2v4jKU.mp4
dust-storm-collective_q6O5PUg9.mp4

martian_helicopter_top

graph TD
    A[User Input] -->|/alpha_c, /alpha_s| D[Flight Simulation Plugin]
    A -->|/desired_altitude| C[Flight Control Plugin]
    C -->|/angle_of_attack| D
    D -->|LIft/ Drag Forces & Torques| E[Gazebo Physics Engine]
    E -->|Physics Update| F[Ingenuity Model]
    F -->|State Feedback| E
    E -->|Model State| D
    D -->|Telemetry| G[Visualization]
    
    subgraph Gazebo Simulation
    E
    F
    end
    
    subgraph Gazebo Plugins
    C
    D
    end
    
    classDef userInput fill:#f9f,stroke:#333,stroke-width:2px;
    classDef gazebo fill:#cfc,stroke:#333,stroke-width:2px;
    classDef spaceROS fill:#fcf,stroke:#333,stroke-width:2px;
    classDef visualization fill:#ccf,stroke:#333,stroke-width:2px;
    
    class A userInput;
    class E,F gazebo;
    class C,D spaceROS;
    class G visual
Loading

@BarisYazici BarisYazici force-pushed the feat/ingenuity-helicopter-simulation branch from 6631108 to 8d4aa7d Compare September 4, 2024 22:40
@mkhansenbot mkhansenbot self-requested a review September 5, 2024 16:24
Copy link
Contributor

@mkhansenbot mkhansenbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the submission, this looks very cool! However, I need you to follow our contribution guidelines and open a new issue for this demo (using our feature request template). Then update both the PR title and the commit message(s) to refer to that issue #. We require every commit to have an associated issue. Also, I've added a workflow to build the build.sh files automatically, so this must build successfully using your script.

@BarisYazici
Copy link
Author

Thank you for your feedback. I will update the PR based on your comments. I have some questions and suggestions:

Feature Separation

I have implemented multiple features in this PR:

  • Realistic helicopter simulation
  • Automatic altitude control with PID for the collective input of simulation
  • Realistic Mars environment mesh and rocks
  • Mars dust storm simulation
  • Sensor support:
    • Altimeter
    • RGB Camera
    • IMU
  • Realistic wind support

Would it make sense to separate these into individual issues and reference them in separate commits?

Build Script and Docker Image

Regarding the build script, there's a potential issue with the current workflow. My script relies ‘openrobotics/space_robots_demo’ that comes as an artifact from the docker repo under the space-ros project. To address this, I have two questions:

  1. Should I base my Dockerfile on Space-ROS's publicly available Docker image?
  2. Is there a plan to make the ‘openrobotics/space_robots_demo’ image I'm currently basing on available on Docker Hub?

@mkhansenbot
Copy link
Contributor

Thank you for your feedback. I will update the PR based on your comments. I have some questions and suggestions:

Feature Separation

I have implemented multiple features in this PR:

* Realistic helicopter simulation

* Automatic altitude control with PID for the collective input of simulation

* Realistic Mars environment mesh and rocks

* Mars dust storm simulation

* Sensor support:
  
  * Altimeter
  * RGB Camera
  * IMU

* Realistic wind support

Would it make sense to separate these into individual issues and reference them in separate commits?
Since this is an all new demo, I don't think that's necessary. Just document what these capabilities are in your README, etc.

Build Script and Docker Image

Regarding the build script, there's a potential issue with the current workflow. My script relies ‘openrobotics/space_robots_demo’ that comes as an artifact from the docker repo under the space-ros project. To address this, I have two questions:

1. Should I base my Dockerfile on Space-ROS's publicly available Docker image?

Yes, please use the space-ros:latest image as a starting point

2. Is there a plan to make the ‘openrobotics/space_robots_demo’ image I'm currently basing on available on Docker Hub?

There's no current plan to do that. For now, you can copy that folder into your workspace and build it. In fact, can you have your build script do that at build time for now? We plan to port that folder into this repo soon anyway, then we can update the build script.

Copy link
Contributor

@mkhansenbot mkhansenbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the build.sh. This still needs a full review but I'm going to try to run the CI.

@mkhansenbot mkhansenbot dismissed their stale review September 6, 2024 22:01

Needs code review

@BarisYazici
Copy link
Author

Okay I will update it with space-ros docker image. I haven’t pushed anything new yet. Could you also tell me if I should open multiple issues for multiple features or one issue listing multiple features?

@gmacario
Copy link

Okay I will update it with space-ros docker image. I haven’t pushed anything new yet. Could you also tell me if I should open multiple issues for multiple features or one issue listing multiple features?

According to @mkhansenbot comment in #39 (comment)

Since this is an all new demo, I don't think that's necessary. Just document what these capabilities are in your README, etc.

@mkhansenbot mkhansenbot force-pushed the feat/ingenuity-helicopter-simulation branch from 8d4aa7d to 72b8d8e Compare September 11, 2024 14:52
Copy link
Contributor

@mkhansenbot mkhansenbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your submission, however this doesn't build in our CI, because you're relying on the 'space_robots' docker image, which you're not building. So there are two options:

  1. build on the space-ros:latest image only, pull in any assets you need from the space-ros/simulation repo
  2. Implement a multi-stage build where you first build the space_robots image then you build yours on top of that

I recommend option 1 if possible, as the space_robots demo will be refactored and moved into this repo later, so it's preferable to remove that dependency if you can

…nd control

fix: docker container support
@BarisYazici BarisYazici force-pushed the feat/ingenuity-helicopter-simulation branch from 11373e3 to 2310827 Compare September 11, 2024 19:46
@BarisYazici
Copy link
Author

Thanks for your submission, however this doesn't build in our CI, because you're relying on the 'space_robots' docker image, which you're not building. So there are two options:

  1. build on the space-ros:latest image only, pull in any assets you need from the space-ros/simulation repo
  2. Implement a multi-stage build where you first build the space_robots image then you build yours on top of that

I recommend option 1 if possible, as the space_robots demo will be refactored and moved into this repo later, so it's preferable to remove that dependency if you can

Thanks @mkhansenbot for the update. I updated the dockerfile to be based on space-ros public image and the build script. Workflow should hopefully work now.

@mkhansenbot
Copy link
Contributor

Re-running the build

source /home/spaceros-user/spaceros/install/setup.sh
source /opt/ros/humble/setup.sh
cd /home/spaceros-user/ingenuity_helicopter
colcon build --packages-select helicopter_flight_control helicopter_flight_simulation ingenuity_description ingenuity_bringup
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move the colcon build into the Dockerfile so that we can ensure the build works correctly using CI

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the Dockerfile with the colcon build command. Also adjusted the entrypoint.sh such that it directly start the launch file.

mkhansenbot
mkhansenbot previously approved these changes Sep 13, 2024
@mkhansenbot mkhansenbot self-requested a review September 13, 2024 20:42
@mkhansenbot mkhansenbot dismissed their stale review September 13, 2024 20:42

This still needs a full code review

@Bckempa Bckempa added the Summer Sprint NASA Space ROS Sim Summer Sprint Challenge 2024 label Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Summer Sprint NASA Space ROS Sim Summer Sprint Challenge 2024
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Realistic Ingenuity Flight Simulator
4 participants