Giter Club home page Giter Club logo

Comments (11)

Winter-Guerra avatar Winter-Guerra commented on July 4, 2024

Hi @ashwinvk94,

At the moment, restarting the launch file is the only way to restart the simulation after a collision. If you'd like to do tests without collisions enabled, it is possible to disable them. We're looking into making an easier way of restarting the simulation in the future, but for right now restarting the launch file or disabling collisions is the only way.

Best,
-Winter

from flightgoggles.

ashwinvk94 avatar ashwinvk94 commented on July 4, 2024

Got it thanks.

from flightgoggles.

PHRABAL avatar PHRABAL commented on July 4, 2024

@Winter-Guerra I've disabled collisions, the drone starts to fly, then I want to reset it. Is /uav/input/reset topic working? I've tried a number of ways to publish to it and nothing seems to reset it (by which I mean put the drone back to the starting position on the ground).

For example, I've tried amongst others:

rostopic pub /uav/input/reset std_msgs/Empty "{}"

When I initiate that command, I get the following output and nothing ever happens with the drone:

publishing and latching message. Press ctrl-C to terminate

I see there are no subscribers to that topic. Is that a mistake or is there another way to reset the drone?

from flightgoggles.

Winter-Guerra avatar Winter-Guerra commented on July 4, 2024

Hi @PHRABAL, restarting the dynamics node is currently the fastest way to reset the drone to the start position. However, we accept pull requests!

from flightgoggles.

Winter-Guerra avatar Winter-Guerra commented on July 4, 2024

Hi all,

We have an initial implementation of a quick reset function. In our implementation the drone will reset position on every collision. We're currently testing the patch and will release as soon as possible.

Best,
-Winter

from flightgoggles.

PHRABAL avatar PHRABAL commented on July 4, 2024

@Winter-Guerra great. In the meantime, I implemented a function to reset the env which does a rosnode kill combined with setting those nodes to respawn=True in the launch file. It works. Takes about 1-2 seconds to complete the loop on a p3.

from flightgoggles.

Winter-Guerra avatar Winter-Guerra commented on July 4, 2024

The new patch is out! FlightGoggles should reset the drone to the start position after a collision.

# Pull new flightgoggles source code
cd ~/catkin_ws/src/flightgoggles
git pull
# Force flightgoggles to redownload binary at build time
catkin clean
catkin build

from flightgoggles.

PHRABAL avatar PHRABAL commented on July 4, 2024

@Winter-Guerra Thanks for the quick add of this function. If we want to reset it manually other than a collision, is there a way to do that? Sometimes the drone gets "stuck" without registering an actual collision. There's actually a bunch of scenarios during training where we want to reset the drone other than an actual collision too. I can keep using my old way, but would love to use the new reset function if it's accessible.

from flightgoggles.

eatal avatar eatal commented on July 4, 2024

Hi @PHRABAL ,
You can reset the dynamics by publishing an empty message std_msgs/Empty to the ropic /uav/collision. E.g. from a terminal using the command:
rostopic pub /uav/collision std_msgs/Empty

Note that there is a timeout after each reset, during which the drone cannot go to armed state (similar to when the simulation is initialized and no thrust commands have been given yet). The timeout is set to 0.1 seconds by default, but you can change this in src/FlightGoggles/flightgoggles/config/drone/drone.yamlwhere the parameter is listed as reset_timeout.

Hope this helps,
-Ezra

from flightgoggles.

PHRABAL avatar PHRABAL commented on July 4, 2024

@eatal you made my day ... maybe week.

from flightgoggles.

Winter-Guerra avatar Winter-Guerra commented on July 4, 2024

Closing since this feature request has been implemented. Instructions for manual reset will be added to the README FAQ.

from flightgoggles.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.