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

How can I get collision information with AirSim ROS Wrapper? #4424

Open
shuaikangma opened this issue Mar 20, 2022 · 2 comments · May be fixed by #4426
Open

How can I get collision information with AirSim ROS Wrapper? #4424

shuaikangma opened this issue Mar 20, 2022 · 2 comments · May be fixed by #4426

Comments

@shuaikangma
Copy link

Question

What's your question?

How can I get collision information with AirSim ROS Wrapper?

Include context on what you are trying to achieve

I want to use AirSim in a drl-based navigation system. I just want to get a collision trigger and the give my agent a negative reward , then reset the env.

Context details

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

Include details of what you already did to find answers

By the way, 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?

@shuaikangma
Copy link
Author

I attempt to use airsim_client_->simGetCollisionInfo(vehicle_ros->vehicle_name) and drone->curr_drone_state.collision.has_collided in ros::Time AirsimROSWrapper::update_state() at ~/AirSim/ros/src/airsim_ros_pkgs/src/airsim_ros_wrapper.cpp to get the collision information, but both of them return 0(I print the CollisionInfo.time_stamp, but it turns to be 0).

@shuaikangma
Copy link
Author

My fault!
I didn't print CollisionInfo.has_collision when test airsim_client_->simGetCollisionInfo(vehicle_ros->vehicle_name), it really worked! But _**drone->curr_drone_state.collision.has_collided**_ still didn't work.
I fix it in #4426

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants