-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Add ROS2 wrapper #3976
Add ROS2 wrapper #3976
Conversation
- update ros::NodeHandle - update ros::Publisher
_ convert timer to wall timer
- update setParam
- fix TransformBroadcaster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some small nitpicks, thanks a lot for cleaning up the code duplication from the ROS1 code!
Thanks @rajat2004! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more thing which can be done later is to add it in Actions CI, to ensure that it compiles going forward. Docker container can also be used directly here to build
You right, I guess it should be done after the PR is merged |
hey @alonfaraj, I tried following your steps to test the wrapper on Ubuntu locally, but I'm receiving the following compile time error:
I tried remedying this by installing the
Do you know if there's a another dependency I'm missing, or if there's a different gepgraphic-msgs package I need? |
I tested with the
and it built fine. Was ros sourced before building (i.e. |
Hi @zimmy87, sorry about that. You can see that the dockerfile include install of |
Hey @alonfaraj and @jmackay2, thank you for the help. I figured out what was wrong with my ros2 installation: I was following the instructions here which installs from a downloaded tar.bz2 and then I was trying to use apt to install the rest of the dependencies. This ended up creating two different ros2 installations that didn't share the same packages. After uninstalling everything and following the instructions here instead, I was able to get the ros2 wrapper building. What services do we expect to be supported in this version of the ros2 wrapper? I tried calling both
expected: drone should move (either to takeoff or to target)
Am I doing something wrong here or is this outside of the intended scope of this PR (in which case do we have a list somewhere of currently functional services so users know which ones to avoid calling)? |
Hi @zimmy87, glad to hear you solved it! All the topic/services/nodes in ROS1 are supported in a similar way in this ROS2 PR, except |
Thank you for the contribution @alonfaraj! I was able to get the scenario I mentioned previously working after updating to your latest commit. I think the current level of functionality is sufficient for merging. There's a couple things I noticed when testing that I think may be good things to investigate for any future PRs on this wrapper:
|
As per the behaviors I called out for future investigation, I didn't realize at the time that these were all occurring in the ROS1 wrapper as well, so these aren't being introduced in this PR. Feel free to disregard as these are just inherited from the ROS1 wrapper and should be addressed there as well. |
@zimmy87 yep, you right. Regarding the third behavior you mentioned - this is the same behavior in ros1 as well. |
Fixes: #3830
About
Hi,
I found myself using AirSim & ROS but a lot of our logic and code is already implemented with ROS2.
I migrated the existing ROS wrapper to ROS2, with minimal changes as possible.
One major change is a new package contains all messages and services -
airsim_interfaces
.Nodes:
Packages:
Not all launch files were migrated, only the main so far -
This PR probably need much more tests to check that everything work like ROS1 wrapper.
I thought it might be useful to share it with you guys, because ROS2 became very popular.
How Has This Been Tested?
Test configuration:
It might work on different ROS2/Ubuntu versions as well.
Didn't check it.
Ran this ROS2 wrapper node.
Tested on one Multirotor and one Car with different sensors using ros2 command tool and Rviz2
How to test it yourself?
sudo apt-get install gcc-8 g++-8
Verify installation bygcc-8 --version
sudo apt-get install ros-${ROS_DISTRO}-tf2-sensor-msgs ros-${ROS_DISTRO}-tf2-geometry-msgs ros-${ROS_DISTRO}-mavros* libyaml-cpp-dev
https://colcon.readthedocs.io/en/released/user/installation.html
cd /AirSim/ros2
colcon build --cmake-args -DCMAKE_C_COMPILER=gcc-8 --cmake-args -DCMAKE_CXX_COMPILER=g++-8 --cmake-args -DCMAKE_BUILD_TYPE=Debug
or for release
DCMAKE_BUILD_TYPE=Release
source install/setup.bash
ros2 launch airsim_ros_pkgs airsim_node.launch.py