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

Update the support of ubuntu20.04 #700

Open
wants to merge 6 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
47 changes: 46 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ doi="10.1007/978-3-319-26054-9_23",
url="http://dx.doi.org/10.1007/978-3-319-26054-9_23"
}
```
Installation Instructions - Ubuntu 16.04 with ROS Kinetic
Installation Instructions - Ubuntu 20.04 with ROS Noetic
---------------------------------------------------------
1. Install and initialize ROS kinetic desktop full, additional ROS packages, catkin-tools, and wstool:

Expand All @@ -49,6 +49,7 @@ Installation Instructions - Ubuntu 16.04 with ROS Kinetic
$ cd ~/catkin_ws/src
$ catkin_init_workspace # initialize your catkin workspace
$ wstool init
$ git clone https://github.com/ethz-asl/rotors_simulator.git
$ wget https://raw.githubusercontent.com/ethz-asl/rotors_simulator/master/rotors_hil.rosinstall
$ wstool merge rotors_hil.rosinstall
$ wstool update
Expand All @@ -62,7 +63,51 @@ Installation Instructions - Ubuntu 16.04 with ROS Kinetic
$ cd ~/catkin_ws/
$ catkin build
```
3.1. If you don't have `rotors_simulator`

```
$ cd ~/catkin_ws/src
$ git clone https://github.com/ethz-asl/rotors_simulator.git
```
4. Add sourcing to your `.bashrc` file

```
$ echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
$ source ~/.bashrc
```

Installation Instructions - Ubuntu 16.04 with ROS Kinetic
---------------------------------------------------------
1. Install and initialize ROS kinetic desktop full, additional ROS packages, catkin-tools, and wstool:

```
$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list'
$ wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install ros-kinetic-desktop-full ros-kinetic-joy ros-kinetic-octomap-ros ros-kinetic-mavlink python-wstool python-catkin-tools protobuf-compiler libgoogle-glog-dev ros-kinetic-control-toolbox ros-kinetic-mavros
$ sudo rosdep init
$ rosdep update
$ source /opt/ros/kinetic/setup.bash
```
2. If you don't have ROS workspace yet you can do so by

```
$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/src
$ catkin_init_workspace # initialize your catkin workspace
$ wstool init
$ wget https://raw.githubusercontent.com/ethz-asl/rotors_simulator/master/rotors_hil.rosinstall
$ wstool merge rotors_hil.rosinstall
$ wstool update
```

3. Build your workspace with `python_catkin_tools` (therefore you need `python_catkin_tools`)

```
$ cd ~/catkin_ws/
$ catkin build
```

4. Add sourcing to your `.bashrc` file

```
Expand Down
6 changes: 5 additions & 1 deletion rotors_gazebo/launch/mav_with_joy.launch
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
<arg name="enable_ground_truth" value="$(arg enable_ground_truth)" />
<arg name="log_file" value="$(arg log_file)"/>
</include>
<node name="joy_node" pkg="joy" type="joy_node" />
<!-- joy node -->
<node respawn="true" pkg="joy"
type="joy_node" name="joy_node" >
<param name="dev" type="string" value="/dev/input/js1" />
</node>
<node name="rotors_joy_interface" pkg="rotors_joy_interface" type="rotors_joy_interface" />
<node name="roll_pitch_yawrate_thrust_controller_node" pkg="rotors_control" type="roll_pitch_yawrate_thrust_controller_node" output="screen">
<rosparam
Expand Down
9 changes: 7 additions & 2 deletions rotors_gazebo/launch/mav_with_keyboard.launch
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@
<arg name="log_file" value="$(arg log_file)"/>
</include>
<node name="key_joystick" pkg="rotors_joy_interface" type="key_joystick.py" />
<node name="joy_node" pkg="joy" type="joy_node" />
<node name="rotors_joy_interface" pkg="rotors_joy_interface" type="rotors_joy_interface" />
<!-- joy node -->
<node respawn="true" pkg="joy" type="joy_node" name="joy_node" >
<param name="dev" type="string" value="/dev/input/js1" />
</node>
<node name="rotors_joy_interface" pkg="rotors_joy_interface" type="rotors_joy_interface" output="screen">
<param name="axis_direction_thrust" value="-1" />
</node>
<node name="roll_pitch_yawrate_thrust_controller_node" pkg="rotors_control" type="roll_pitch_yawrate_thrust_controller_node" output="screen">
<rosparam
command="load" file="$(find rotors_gazebo)/resource/roll_pitch_yawrate_thrust_controller_$(arg mav_name).yaml" />
Expand Down
9 changes: 6 additions & 3 deletions rotors_joy_interface/src/joy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,17 @@ void Joy::JoyCallback(const sensor_msgs::JoyConstPtr& msg) {
else {
current_yaw_vel_ = 0;
}
control_msg_.yaw_rate = current_yaw_vel_;

control_msg_.yaw_rate = msg->axes[3] * max_.rate_yaw ;
ROS_INFO("hello world! %d", axes_.thrust_direction);
if (is_fixed_wing_) {
double thrust = msg->axes[axes_.thrust] * axes_.thrust_direction;
control_msg_.thrust.x = (thrust >= 0.0) ? thrust : 0.0;
}
else {
control_msg_.thrust.z = (msg->axes[axes_.thrust] + 1) * max_.thrust / 2.0 * axes_.thrust_direction;
control_msg_.thrust.z = (msg->axes[axes_.thrust] * axes_.thrust_direction + 1) * max_.thrust / 2.0 ;



}

ros::Time update_time = ros::Time::now();
Expand Down