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

Migration to Galactic #47

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,20 @@ Before starting hands-on on coding, please check out our issue board to see if w
# Installation #
Plankton currently supports:

- **ROS 2 Galactic** with **Gazebo 9** or **Gazebo 11** and **Ubuntu 20.04**

- **ROS 2 Foxy** with **Gazebo 9** or **Gazebo 11** and **Ubuntu 20.04**

- **ROS 2 Eloquent**, **Ubuntu 18.04** and **Gazebo 9**

### 1. Install ROS 2 Foxy
### 1. Install ROS 2 Foxy or Galactic

If you don’t have ROS 2 Foxy installed, follow the instructions below and prefer to install the `ros-foxy-desktop` package:
If you don’t have ROS 2 Foxy or installed, follow the instructions below and prefer to install the `ros-foxy-desktop` package:
<https://index.ros.org/doc/ros2/Installation/Foxy/Linux-Install-Debians/>

For ROS 2 Galactic the instructions for installing the `ros-galactic-desktop` package can be found here:
<https://index.ros.org/doc/ros2/Installation/Galactic/Linux-Install-Debians/>

### 2. Install Gazebo 11

If you don't have Gazebo 11 installed, open a terminal and follow the steps below:
Expand All @@ -60,9 +65,12 @@ You can write `gazebo` in a terminal to make sure that gazebo runs correctly. Wr

### 3. Install the ros packages for gazebo

Write in a terminal:
For Foxy, write in a terminal:
`sudo apt install ros-foxy-gazebo-ros-pkgs`

For Galactic:
`sudo apt install ros-galactic-gazebo-ros-pkgs`

>See <http://gazebosim.org/tutorials?tut=ros2_installing&cat=connect_ros> for more detailed information about gazebo and ROS 2 connection.

### 4. Build the Plankton plugin
Expand All @@ -80,8 +88,10 @@ Now, clone the Plankton repository:
`git clone https://www.github.com/Liquid-ai/Plankton.git`

At this point, you need to source 2 different files described below to configure ROS 2 and Gazebo environment variables:
- For ROS 2 variables
- For ROS 2 variables (for Foxy)
`source /opt/ros/foxy/setup.bash`
- For ROS 2 variables (for Galactic)
`source /opt/ros/galactic/setup.bash`
- For Gazebo
`source /usr/share/gazebo/setup.sh`

Expand All @@ -97,6 +107,11 @@ Browse to the root of your workspace and check for missing dependencies:
cd ~/ros2_ws/
rosdep install -i --from-path src --rosdistro foxy -y
```
If using Galactic, run instead:
```
cd ~/ros2_ws/
rosdep install -i --from-path src --rosdistro galactic -y
```

Install Colcon, the build tool system:
`sudo apt install python3-colcon-common-extensions`
Expand All @@ -114,8 +129,10 @@ If everything went well, you should be able to run example cases.

Note: Every time you open a new terminal, you need to source 3 different files described below to configure ROS 2 and Gazebo environment variables. Write the following each time you start a new terminal to deal with ROS 2 / Gazebo stuff, or prefer to add them at the end of your .bashrc file with `gedit ~/.bashrc`. For the latter, don’t forget to source your .bashrc to enforce the update after saving these changes, or open a fresh terminal.

- For ROS 2 variables
- For ROS 2 variables (for Foxy)
`source /opt/ros/foxy/setup.bash`
- For ROS 2 variables (for Galactic)
`source /opt/ros/galactic/setup.bash`
- For your installation workspace (change the path accordingly)
`source $HOME/ros2_ws/install/setup.bash`
- For Gazebo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void FinROSPlugin::Load(gazebo::physics::ModelPtr _parent, sdf::ElementPtr _sdf)

myRosNode = gazebo_ros::Node::CreateWithArgs(_sdf->Get<std::string>("name"));// gazebo_ros::Node::Get(_sdf);
//Change the buildtopicprefix function ("/") if creating a namespaced node here
RCLCPP_INFO(myRosNode->get_logger(), "[FinROSPlugin] Namespace: " + std::string(myRosNode->get_namespace()));
RCLCPP_INFO_STREAM(myRosNode->get_logger(), "[FinROSPlugin] Namespace: " << std::string(myRosNode->get_namespace()));
//this->rosNode.reset(new ros::NodeHandle(""));

mySubReference = myRosNode->create_subscription<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <uuv_sensor_ros_plugins_msgs/msg/dvl_beam.hpp>


#include <tf2_ros/buffer.h>
#include <tf2_ros/transform_listener.h>

#include <vector>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <rclcpp/rclcpp.hpp>
#include <nav_msgs/msg/odometry.hpp>
#include <geometry_msgs/msg/transform_stamped.hpp>
#include <tf2_ros/buffer.h>
#include <tf2_ros/transform_listener.h>

#include <gazebo/physics/physics.hh>
Expand Down