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

Fix the problem in ros: can't take off after reset #4426

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

Conversation

shuaikangma
Copy link

@shuaikangma shuaikangma commented Mar 21, 2022

Fixes: #4424

can't take off after reset in ros

About

#4424
I test reset service manually use rqt in ros, it can't take off after reset service being called. I see a commit and merge in the early version, but it may dose't work?

How Has This Been Tested?

According to the api doc:
reset: This resets the vehicle to its original starting state. Note that you must call enableApiControl and armDisarm again after the call to reset.

AIrSim version: #4410
Unreal version: v1.7.0-linux
OS version: ubuntu18.04 with ros-melodic
Use default settiongs :AirSim/ros/settings/front_stereo_and_center_mono.json in #4410

Screenshots (if appropriate):

Screenshot from 2022-03-21 21-31-26

According to the api doc
reset: This resets the vehicle to its original starting state. Note that you must call enableApiControl and armDisarm again after the call to reset.
@ghost
Copy link

ghost commented Mar 21, 2022

CLA assistant check
All CLA requirements met.

@shuaikangma
Copy link
Author

Fixes:
####Add collision state publish in ros, now you can see a topic named /{Vehicle_Name}/collision_state(std_msgs::Bool) to show current collision state of the vehicle named {Vehicle_Name}. False---no cllision; True---collision

About
#4424

How Has This Been Tested?
AIrSim version: #4410
Unreal version: v1.7.0-linux
OS version: ubuntu18.04 with ros-melodic
Use default settiongs :AirSim/ros/settings/front_stereo_and_center_mono.json in #4410

use rqt to publish takeoff srv and vel topic, see the change of the /{Vehicle_Name}/collision_state topic before and after colission.

Screenshots (if appropriate):

After takeoff, none of the two drone is in collision
Screenshot from 2022-03-22 23-06-09

Drone1 is in collision, Drone2 is not
Screenshot from 2022-03-22 23-06-42

Both of them are in collision
Screenshot from 2022-03-22 23-07-13

@zimmy87
Copy link
Contributor

zimmy87 commented Mar 23, 2022

Hey @shuaikangma, thank you for submitting this PR! I tested it locally and it's working for me. However, it seems that your PR is failing the clang-format check. Please follow these steps to resolve this:

  1. check out your pull request
  2. run git checkout master .clang-format in your repo's root folder
  3. if you don't have npm installed, download it from https://www.npmjs.com/get-npm
  4. run npm install -g clang-format
  5. run clang-format -i path/to/file for each failing file (failing files can be found in the details for the clang-format check)
  6. run git add -u to track all style changes
  7. run git commit -am "apply style from clang-format"
  8. run git merge master
  9. resolve other non-style conflicts if you have any
  10. push changes

Thanks for helping us with these style changes!

airsim_client_->reset();

response.success = true;
if(airsim_client_!=nullptr){
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason to have this check? This is created in in the constructor itself, and the ROS service would have failed much earlier if it's null

from airsim_ros_pkgs.srv import TakeoffRequest,Takeoff

msg = """
Control the RoboMaster TT (Tello Talent) through Gamepad
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this latest commit intentional? We're not sure if we want to merge gamepad support for a specific drone. If this script is only relevant to this one drone (Tello Talent), please move this latest commit to a new branch/PR. We'd still like to take the more general reset fix by itself, however.

@jonyMarino jonyMarino changed the base branch from master to main July 17, 2022 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How can I get collision information with AirSim ROS Wrapper?
4 participants