├── LICENSE ├── README.md ├── tuna ├── CMakeLists.txt └── package.xml ├── tuna_bringup ├── CMakeLists.txt ├── config_scripts │ ├── config.txt │ ├── env.sh │ ├── magni-base │ ├── ros_setup.bash │ ├── ros_setup.sh │ ├── roscore │ └── roscore.service ├── launch │ ├── core.launch │ ├── gnss.launch │ └── imu.launch ├── package.xml ├── param │ ├── hyb_slam2d.yaml │ ├── imu_calib.yaml │ └── new_calib.yaml ├── scripts │ ├── ublox.txt │ └── ubxgen.py └── setup.py ├── tuna_description ├── CMakeLists.txt ├── img │ ├── NodeGraph.png │ ├── NodeGraph.xml │ ├── TunaElectric.png │ ├── TunaElectric.xml │ ├── gazebo.png │ ├── grid.png │ ├── image.png │ └── vizanti.jpg ├── launch │ ├── model.launch │ └── odometry.launch ├── nodes │ ├── odom_publisher.py │ └── sim_publisher.py ├── package.xml ├── setup.py └── urdf │ └── boat.urdf ├── tuna_gazebo ├── CMakeLists.txt ├── launch │ ├── bridge.launch │ └── ign.launch ├── meshes │ ├── boat.dae │ ├── map.dae │ ├── prop_left.dae │ ├── prop_right.dae │ └── stl │ │ ├── fin_left_1.stl │ │ ├── fin_left_2.stl │ │ ├── fin_right_1.stl │ │ ├── fin_right_2.stl │ │ ├── gnss_bottom.stl │ │ ├── gnss_top.stl │ │ ├── hook.stl │ │ ├── stern_bottom.stl │ │ ├── stern_top.stl │ │ └── tower.stl ├── package.xml ├── scripts │ ├── ign_interfacer.py │ └── wave_generator.py └── water_world.sdf ├── tuna_motor ├── CMakeLists.txt ├── launch │ └── electronics.launch ├── nodes │ ├── battery.py │ ├── motor.py │ └── shutdown.py ├── package.xml └── setup.py ├── tuna_nav ├── CMakeLists.txt ├── launch │ ├── line_planner.launch │ └── localization.launch ├── nodes │ ├── imu_filter.py │ └── light_indicator.py ├── package.xml └── setup.py └── tuna_viz ├── CMakeLists.txt ├── launch └── rviz.launch ├── package.xml └── rviz └── config.rviz /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 MoffKalast 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Diagram](tuna_description/img/image.png) 2 | 3 | [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) 4 | 5 | # About 6 | 7 | Tuna is an open-electronics and open-software GNSS platform for ROS, based on the Pi 4. It uses diff drive control for locomotion with [diff_drive_simple](https://github.com/MoffKalast/diff_drive_simple), a standard percision GNSS receiver for absolute localization with [navsat_simple](https://github.com/MoffKalast/navsat_simple), and an IMU for rotational data. If you see the overreaching theme there, I'm trying to keep everything as simple as possible. 8 | 9 | In the current iteration it uses [Vizanti](https://github.com/MoffKalast/vizanti) as the mission planner and [line_planner](https://github.com/MoffKalast/line_planner) as its local planner. You can find more specific info below or in the related videos. 10 | 11 | List of videos about construction and testing: 12 | 13 | | Video | Description | 14 | | ----------- | ----------- | 15 | | [![Watch the video](https://img.youtube.com/vi/CoFgflu3uPA/default.jpg)](https://www.youtube.com/watch?v=CoFgflu3uPA) | Hardware setup and general software stack info, initial testing with ROS Mobile and navsat_transform_node. | 16 | | [![Watch the video](https://img.youtube.com/vi/l3ynv3hPWGs/default.jpg)](https://www.youtube.com/watch?v=l3ynv3hPWGs) | Practical navigation experiments with proprietary EZ-Map and gps_common. Simulation in Ignition Gazebo. | 17 | | [![Watch the video](https://img.youtube.com/vi/NZO6q_YMRwI/default.jpg)](https://www.youtube.com/watch?v=NZO6q_YMRwI) | Open source navigation and interface with Vizanti, developing the more accurate line_planner. Survey pattern tests. | 18 | 19 | 20 | 21 | # Circuit Diagram 22 | 23 | ![Diagram](tuna_description/img/TunaElectric.png) 24 | 25 | # Node Graph 26 | 27 | ![Diagram](tuna_description/img/NodeGraph.png) 28 | 29 | # Installation 30 | 31 | ## Running in Gazebo Fortress 32 | 33 | ![Gazebo](tuna_description/img/gazebo.png) 34 | 35 | Base requirements: 36 | - [ROS Noetic](http://wiki.ros.org/noetic/Installation/Ubuntu) 37 | - [Gazebo Ignition (version Fortress)](https://gazebosim.org/docs/fortress/install_ubuntu) 38 | - [ros_ign bridge for Noetic](https://github.com/gazebosim/ros_gz/tree/noetic#from-source) 39 | 40 | Clone repos: 41 | 42 | ```bash 43 | cd ~/catkin_ws/src 44 | git clone https://github.com/MoffKalast/tuna.git 45 | # Diff drive controller 46 | git clone https://github.com/MoffKalast/diff_drive_simple.git 47 | # Localization fusion 48 | git clone https://github.com/MoffKalast/navsat_simple.git 49 | # Goal planner 50 | git clone https://github.com/MoffKalast/line_planner.git 51 | 52 | # Optional, for RViz Viewing 53 | git clone https://github.com/nobleo/rviz_satellite.git 54 | 55 | # ign bridge setup, skip if already installed 56 | export IGNITION_VERSION=fortress 57 | git clone https://github.com/osrf/ros_ign.git -b noetic 58 | 59 | cd ~/catkin_ws 60 | rosdep install --from-paths src --ignore-src --rosdistro=noetic -y 61 | catkin_make 62 | ``` 63 | 64 | Run: 65 | ```bash 66 | # Run the sim 67 | roscd tuna_gazebo 68 | ign gazebo water_world.sdf -r 69 | 70 | # Run bridge and navigation nodes 71 | roslaunch tuna_gazebo ign.launch 72 | 73 | # Visualize 74 | roslaunch tuna_viz rviz.launch 75 | 76 | # Turn on currnent/wind simulation 77 | rosrun tuna_gazebo wave_generator.py 78 | 79 | ``` 80 | 81 |
82 | 83 | ## Running with Vizanti 84 | 85 | ![Vizanti](tuna_description/img/vizanti.jpg) 86 | 87 | Install: 88 | 89 | ```bash 90 | cd ~/catkin_ws/src 91 | https://github.com/MoffKalast/vizanti.git 92 | cd .. 93 | rosdep install --from-paths src --ignore-src --rosdistro=noetic -y 94 | catkin_make 95 | ``` 96 | 97 | Run: 98 | ```bash 99 | roslaunch vizanti server.launch 100 | ``` 101 | Then view http://localhost:5000 102 | 103 |
104 | 105 | ## Running on a Raspberry Pi 106 | 107 | Clone hw drivers: 108 | ```bash 109 | cd ~/catkin_ws/src 110 | git clone https://github.com/dpkoch/imu_calib.git 111 | git clone https://github.com/MoffKalast/onewiretemp.git 112 | git clone https://github.com/MoffKalast/safety_light.git 113 | git clone https://github.com/MoffKalast/mpu9255.git 114 | 115 | cd ~/catkin_ws 116 | rosdep install --from-paths src --ignore-src --rosdistro=noetic -y 117 | catkin_make 118 | ``` 119 | 120 | To run this on a Pi 4, start with a [20.04 Ubuntu Pi image](https://learn.ubiquityrobotics.com/noetic_pi_image_downloads), install everything as listed above, plus [pigpio](https://abyz.me.uk/rpi/pigpio/download.html). 121 | 122 | Fix services to set up correct ROS params and autorun at boot: 123 | 124 | ```bash 125 | cd ~/catkin_ws/src/tuna/tuna_bringup/config_scripts 126 | sudo cp roscore.service /etc/systemd/system/roscore.service 127 | 128 | sudo cp magni-base /usr/sbin/magni-base 129 | sudo cp roscore /usr/sbin/roscore 130 | 131 | sudo cp env.sh /etc/ubiquity/env.sh 132 | sudo cp ros_setup.bash /etc/ubiquity/ros_setup.bash 133 | sudo cp ros_setup.sh /etc/ubiquity/ros_setup.sh 134 | ``` 135 | 136 | Changes to `/boot/config.txt` for i2c, uart, and LED power saving: 137 | 138 | ```bash 139 | # disable rainbow splash screen for faster booting 140 | disable_splash=1 141 | 142 | # Set up UART and disable BT 143 | dtoverlay=disable-bt 144 | dtoverlay=uart0 145 | 146 | # Set up I2C 147 | dtoverlay=i2c-gpio,i2c_gpio_sda=2,i2c_gpio_scl=3,bus=1 core_freq=250 148 | 149 | # Disable the PWR LED 150 | dtparam=pwr_led_trigger=none 151 | dtparam=pwr_led_activelow=off 152 | 153 | # Disable the Activity LED 154 | dtparam=act_led_trigger=none 155 | dtparam=act_led_activelow=off 156 | 157 | # Disable ethernet port LEDs 158 | dtparam=eth_led0=4 159 | dtparam=eth_led1=4 160 | ``` 161 | 162 | ### Enable Kernel Interfaces 163 | 164 | For the `safety_light` to have the correct kernel interface access create `/etc/udev/rules.d/99-gpio.rules` with the following contents (if it doesn't already exist): 165 | 166 | ```bash 167 | SUBSYSTEM=="bcm2835-gpiomem", KERNEL=="gpiomem", GROUP="gpio", MODE="0660" 168 | SUBSYSTEM=="gpio", KERNEL=="gpiochip*", ACTION=="add", RUN+="/bin/sh -c 'chown root:gpio /sys/class/gpio/export /sys/class/gpio/unexport ; chmod 220 /sys/class/gpio/export /sys/class/gpio/unexport'" 169 | SUBSYSTEM=="gpio", KERNEL=="gpio*", ACTION=="add", RUN+="/bin/chown root:gpio /sys%p/active_low /sys%p/edge /sys%p/direction /sys%p/value", RUN+="/bin/chmod 660 /sys%p/active_low /sys%p/edge /sys%p/direction /sys%p/value" 170 | ``` 171 | ### Run 172 | 173 | This launch file will also launch automatically at boot via the magni-base service. 174 | 175 | ```bash 176 | roslaunch tuna_bringup core.launch 177 | ``` 178 | -------------------------------------------------------------------------------- /tuna/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(tuna) 3 | find_package(catkin REQUIRED) 4 | catkin_metapackage() 5 | -------------------------------------------------------------------------------- /tuna/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | tuna 4 | 0.1.0 5 | All Karl self driving rc car related packages. 6 | 7 | Rohan Agrawal 8 | BSD 9 | 10 | catkin 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tuna_bringup/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(tuna_bringup) 3 | 4 | find_package(catkin REQUIRED COMPONENTS 5 | roscpp 6 | rospy 7 | sensor_msgs 8 | message_generation 9 | std_msgs 10 | ) 11 | 12 | catkin_python_setup() 13 | 14 | generate_messages(DEPENDENCIES std_msgs) 15 | 16 | catkin_package( 17 | CATKIN_DEPENDS std_msgs sensor_msgs message_runtime 18 | ) 19 | -------------------------------------------------------------------------------- /tuna_bringup/config_scripts/config.txt: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ## Raspberry Pi Configuration Settings 3 | ## 4 | ## Revision 16, 2013/06/22 5 | ## 6 | ## Details taken from the eLinux wiki 7 | ## For up-to-date information please refer to wiki page. 8 | ## 9 | ## Wiki Location : http://elinux.org/RPiconfig 10 | ## 11 | ## For more options and information see 12 | ## http://www.raspberrypi.org/documentation/configuration/config-txt.md 13 | ## Some settings may impact device functionality. See link above for details 14 | ## 15 | ## Description: 16 | ## Details of each setting are described with each section that begins with 17 | ## a double hashed comment ('##') 18 | ## It is up to the user to remove the single hashed comment ('#') from each 19 | ## option they want to enable, and to set the specific value of that option. 20 | ## 21 | ## Overclock settings will be disabled at runtime if the SoC reaches temp_limit 22 | ## 23 | ################################################################################ 24 | 25 | ################################################################################ 26 | ## Standard Definition Video Settings 27 | ################################################################################ 28 | 29 | ## sdtv_mode 30 | ## defines the TV standard for composite output 31 | ## 32 | ## Value Description 33 | ## ------------------------------------------------------------------------- 34 | ## 0 Normal NTSC (Default) 35 | ## 1 Japanese version of NTSC - no pedestal 36 | ## 2 Normal PAL 37 | ## 3 Brazilian version of PAL - 525/60 rather than 625/50, different 38 | ## subcarrier 39 | ## 40 | #sdtv_mode=0 41 | 42 | ## sdtv_aspect 43 | ## defines the aspect ratio for composite output 44 | ## 45 | ## Value Description 46 | ## ------------------------------------------------------------------------- 47 | ## 1 4:3 (Default) 48 | ## 2 14:9 49 | ## 3 16:9 50 | ## 51 | #sdtv_aspect=1 52 | 53 | ## sdtv_disable_colourburst 54 | ## Disables colour burst on composite output. The picture will be 55 | ## monochrome, but possibly sharper 56 | ## 57 | ## Value Description 58 | ## ------------------------------------------------------------------------- 59 | ## 0 Colour burst is enabled (Default) 60 | ## 1 Colour burst is disabled 61 | ## 62 | #sdtv_disable_colourburst=1 63 | 64 | ################################################################################ 65 | ## High Definition Video Settings 66 | ################################################################################ 67 | 68 | ## hdmi_safe 69 | ## Use "safe mode" settings to try to boot with maximum hdmi compatibility. 70 | ## 71 | ## Value Description 72 | ## ------------------------------------------------------------------------- 73 | ## 0 Disabled (Default) 74 | ## 1 Enabled (this does: hdmi_force_hotplug=1, 75 | ## hdmi_ignore_edid=0xa5000080, 76 | ## config_hdmi_boost=4, hdmi_group=2, 77 | ## hdmi_mode=4, disable_overscan=0, 78 | ## overscan_left=24, overscan_right=24, 79 | ## overscan_top=24, overscan_bottom=24) 80 | ## 81 | #hdmi_safe=1 82 | 83 | ## hdmi_force_hotplug 84 | ## Pretends HDMI hotplug signal is asserted so it appears a HDMI display 85 | ## is attached 86 | ## 87 | ## Value Description 88 | ## ------------------------------------------------------------------------- 89 | ## 0 Disabled (Default) 90 | ## 1 Use HDMI mode even if no HDMI monitor is detected 91 | ## 92 | #hdmi_force_hotplug=1 93 | 94 | ## hdmi_ignore_hotplug 95 | ## Pretends HDMI hotplug signal is not asserted so it appears a HDMI 96 | ## display is not attached 97 | ## 98 | ## Value Description 99 | ## ------------------------------------------------------------------------- 100 | ## 0 Disabled (Default) 101 | ## 1 Use composite mode even if HDMI monitor is detected 102 | ## 103 | #hdmi_ignore_hotplug=1 104 | 105 | ## hdmi_drive 106 | ## chooses between HDMI and DVI modes 107 | ## 108 | ## Value Description 109 | ## ------------------------------------------------------------------------- 110 | ## 1 Normal DVI mode (No sound) 111 | ## 2 Normal HDMI mode (Sound will be sent if supported and enabled) 112 | ## 113 | #hdmi_drive=2 114 | 115 | ## hdmi_ignore_edid 116 | ## Enables the ignoring of EDID/display data 117 | ## 118 | #hdmi_ignore_edid=0xa5000080 119 | 120 | ## hdmi_edid_file 121 | ## Read the EDID data from the edid.dat file instead of from the attached 122 | ## device 123 | ## 124 | ## Value Description 125 | ## ------------------------------------------------------------------------- 126 | ## 0 Read EDID data from attached device (Default) 127 | ## 1 Read EDID data from edid.txt file 128 | ## 129 | #hdmi_edid_file=1 130 | 131 | ## hdmi_ignore_edid_audio 132 | ## Pretends all audio formats are unsupported by display. This means ALSA 133 | ## will default to analogue. 134 | ## 135 | ## Value Description 136 | ## ------------------------------------------------------------------------- 137 | ## 0 Use EDID provided values (Default) 138 | ## 1 Pretend all audio formats are unsupported 139 | ## 140 | #hdmi_ignore_edid_audio=1 141 | 142 | ## hdmi_force_edid_audio 143 | ## Pretends all audio formats are supported by display, allowing 144 | ## passthrough of DTS/AC3 even when not reported as supported. 145 | ## 146 | ## Value Description 147 | ## ------------------------------------------------------------------------- 148 | ## 0 Use EDID provided values (Default) 149 | ## 1 Pretend all audio formats are supported 150 | ## 151 | #hdmi_force_edid_audio=1 152 | 153 | ## hdmi_force_edid_3d 154 | ## Pretends all CEA modes support 3D even when edid doesn't indicate 155 | ## support for them. 156 | ## 157 | ## Value Description 158 | ## ------------------------------------------------------------------------- 159 | ## 0 Use EDID provided values (Default) 160 | ## 1 Pretend 3D mode is supported 161 | ## 162 | #hdmi_force_edid_3d=1 163 | 164 | ## avoid_edid_fuzzy_match 165 | ## Avoid fuzzy matching of modes described in edid. 166 | ## 167 | ## Value Description 168 | ## ------------------------------------------------------------------------- 169 | ## 0 Use fuzzy matching (Default) 170 | ## 1 Avoid fuzzy matching 171 | ## 172 | #avoid_edid_fuzzy_match=1 173 | 174 | ## hdmi_pixel_encoding 175 | ## Force the pixel encoding mode. 176 | ## By default it will use the mode requested from edid so shouldn't 177 | ## need changing. 178 | ## 179 | ## Value Description 180 | ## ------------------------------------------------------------------------- 181 | ## 0 Use EDID provided values (Default) 182 | ## 1 RGB limited (16-235) 183 | ## 2 RGB full ( 0-255) 184 | ## 3 YCbCr limited (16-235) 185 | ## 4 YCbCr limited ( 0-255) 186 | ## 187 | #hdmi_pixel_encoding=1 188 | 189 | ## hdmi_group 190 | ## Defines the HDMI type 191 | ## 192 | ## Value Description 193 | ## ------------------------------------------------------------------------- 194 | ## 0 Use the preferred group reported by the edid (Default) 195 | ## 1 CEA 196 | ## 2 DMT 197 | ## 198 | #hdmi_group=1 199 | 200 | ## hdmi_mode 201 | ## defines screen resolution in CEA or DMT format 202 | ## 203 | ## H means 16:9 variant (of a normally 4:3 mode). 204 | ## 2x means pixel doubled (i.e. higher clock rate, with each pixel repeated 205 | ## twice) 206 | ## 4x means pixel quadrupled (i.e. higher clock rate, with each pixel 207 | ## repeated four times) 208 | ## reduced blanking means fewer bytes are used for blanking within the data 209 | ## stream (i.e. lower clock rate, with fewer wasted bytes) 210 | ## 211 | ## Value hdmi_group=CEA hdmi_group=DMT 212 | ## ------------------------------------------------------------------------- 213 | ## 1 VGA 640x350 85Hz 214 | ## 2 480p 60Hz 640x400 85Hz 215 | ## 3 480p 60Hz H 720x400 85Hz 216 | ## 4 720p 60Hz 640x480 60Hz 217 | ## 5 1080i 60Hz 640x480 72Hz 218 | ## 6 480i 60Hz 640x480 75Hz 219 | ## 7 480i 60Hz H 640x480 85Hz 220 | ## 8 240p 60Hz 800x600 56Hz 221 | ## 9 240p 60Hz H 800x600 60Hz 222 | ## 10 480i 60Hz 4x 800x600 72Hz 223 | ## 11 480i 60Hz 4x H 800x600 75Hz 224 | ## 12 240p 60Hz 4x 800x600 85Hz 225 | ## 13 240p 60Hz 4x H 800x600 120Hz 226 | ## 14 480p 60Hz 2x 848x480 60Hz 227 | ## 15 480p 60Hz 2x H 1024x768 43Hz DO NOT USE 228 | ## 16 1080p 60Hz 1024x768 60Hz 229 | ## 17 576p 50Hz 1024x768 70Hz 230 | ## 18 576p 50Hz H 1024x768 75Hz 231 | ## 19 720p 50Hz 1024x768 85Hz 232 | ## 20 1080i 50Hz 1024x768 120Hz 233 | ## 21 576i 50Hz 1152x864 75Hz 234 | ## 22 576i 50Hz H 1280x768 reduced blanking 235 | ## 23 288p 50Hz 1280x768 60Hz 236 | ## 24 288p 50Hz H 1280x768 75Hz 237 | ## 25 576i 50Hz 4x 1280x768 85Hz 238 | ## 26 576i 50Hz 4x H 1280x768 120Hz reduced blanking 239 | ## 27 288p 50Hz 4x 1280x800 reduced blanking 240 | ## 28 288p 50Hz 4x H 1280x800 60Hz 241 | ## 29 576p 50Hz 2x 1280x800 75Hz 242 | ## 30 576p 50Hz 2x H 1280x800 85Hz 243 | ## 31 1080p 50Hz 1280x800 120Hz reduced blanking 244 | ## 32 1080p 24Hz 1280x960 60Hz 245 | ## 33 1080p 25Hz 1280x960 85Hz 246 | ## 34 1080p 30Hz 1280x960 120Hz reduced blanking 247 | ## 35 480p 60Hz 4x 1280x1024 60Hz 248 | ## 36 480p 60Hz 4x H 1280x1024 75Hz 249 | ## 37 576p 50Hz 4x 1280x1024 85Hz 250 | ## 38 576p 50Hz 4x H 1280x1024 120Hz reduced blanking 251 | ## 39 1080i 50Hz reduced blanking 1360x768 60Hz 252 | ## 40 1080i 100Hz 1360x768 120Hz reduced blanking 253 | ## 41 720p 100Hz 1400x1050 reduced blanking 254 | ## 42 576p 100Hz 1400x1050 60Hz 255 | ## 43 576p 100Hz H 1400x1050 75Hz 256 | ## 44 576i 100Hz 1400x1050 85Hz 257 | ## 45 576i 100Hz H 1400x1050 120Hz reduced blanking 258 | ## 46 1080i 120Hz 1440x900 reduced blanking 259 | ## 47 720p 120Hz 1440x900 60Hz 260 | ## 48 480p 120Hz 1440x900 75Hz 261 | ## 49 480p 120Hz H 1440x900 85Hz 262 | ## 50 480i 120Hz 1440x900 120Hz reduced blanking 263 | ## 51 480i 120Hz H 1600x1200 60Hz 264 | ## 52 576p 200Hz 1600x1200 65Hz 265 | ## 53 576p 200Hz H 1600x1200 70Hz 266 | ## 54 576i 200Hz 1600x1200 75Hz 267 | ## 55 576i 200Hz H 1600x1200 85Hz 268 | ## 56 480p 240Hz 1600x1200 120Hz reduced blanking 269 | ## 57 480p 240Hz H 1680x1050 reduced blanking 270 | ## 58 480i 240Hz 1680x1050 60Hz 271 | ## 59 480i 240Hz H 1680x1050 75Hz 272 | ## 60 1680x1050 85Hz 273 | ## 61 1680x1050 120Hz reduced blanking 274 | ## 62 1792x1344 60Hz 275 | ## 63 1792x1344 75Hz 276 | ## 64 1792x1344 120Hz reduced blanking 277 | ## 65 1856x1392 60Hz 278 | ## 66 1856x1392 75Hz 279 | ## 67 1856x1392 120Hz reduced blanking 280 | ## 68 1920x1200 reduced blanking 281 | ## 69 1920x1200 60Hz 282 | ## 70 1920x1200 75Hz 283 | ## 71 1920x1200 85Hz 284 | ## 72 1920x1200 120Hz reduced blanking 285 | ## 73 1920x1440 60Hz 286 | ## 74 1920x1440 75Hz 287 | ## 75 1920x1440 120Hz reduced blanking 288 | ## 76 2560x1600 reduced blanking 289 | ## 77 2560x1600 60Hz 290 | ## 78 2560x1600 75Hz 291 | ## 79 2560x1600 85Hz 292 | ## 80 2560x1600 120Hz reduced blanking 293 | ## 81 1366x768 60Hz 294 | ## 82 1080p 60Hz 295 | ## 83 1600x900 reduced blanking 296 | ## 84 2048x1152 reduced blanking 297 | ## 85 720p 60Hz 298 | ## 86 1366x768 reduced blanking 299 | ## 300 | #hdmi_mode=1 301 | 302 | ## config_hdmi_boost 303 | ## configure the signal strength of the HDMI interface. 304 | ## 305 | ## Value Description 306 | ## ------------------------------------------------------------------------- 307 | ## 0 (Default) 308 | ## 1 309 | ## 2 310 | ## 3 311 | ## 4 Try if you have interference issues with HDMI 312 | ## 5 313 | ## 6 314 | ## 7 Maximum 315 | ## 316 | #config_hdmi_boost=0 317 | 318 | ## hdmi_ignore_cec_init 319 | ## Doesn't sent initial active source message. Avoids bringing 320 | ## (CEC enabled) TV out of standby and channel switch when rebooting. 321 | ## 322 | ## Value Description 323 | ## ------------------------------------------------------------------------- 324 | ## 0 Normal behaviour (Default) 325 | ## 1 Doesn't sent initial active source message 326 | ## 327 | #hdmi_ignore_cec_init=1 328 | 329 | ## hdmi_ignore_cec 330 | ## Pretends CEC is not supported at all by TV. 331 | ## No CEC functions will be supported. 332 | ## 333 | ## Value Description 334 | ## ------------------------------------------------------------------------- 335 | ## 0 Normal behaviour (Default) 336 | ## 1 Pretend CEC is not supported by TV 337 | ## 338 | #hdmi_ignore_cec=1 339 | 340 | ################################################################################ 341 | ## Overscan Video Settings 342 | ################################################################################ 343 | 344 | ## Use the following to adjust overscan. Use positive numbers if console 345 | ## goes off screen, and negative if there is too much border 346 | 347 | ## overscan_left 348 | ## Number of pixels to skip on left 349 | ## 350 | #overscan_left=0 351 | 352 | ## overscan_right 353 | ## Number of pixels to skip on right 354 | ## 355 | #overscan_right=0 356 | 357 | ## overscan_top 358 | ## Number of pixels to skip on top 359 | ## 360 | #overscan_top=0 361 | 362 | ## overscan_bottom 363 | ## Number of pixels to skip on bottom 364 | ## 365 | #overscan_bottom=0 366 | 367 | ## disable_overscan 368 | ## Set to 1 to disable overscan 369 | ## Disable overscan if your display has a black border of unused pixels 370 | ## visible and your display can output without overscan 371 | ## 372 | ## Value Description 373 | ## ------------------------------------------------------------------------- 374 | ## 0 Overscan Enabled (Default) 375 | ## 1 Overscan Disabled 376 | ## 377 | #disable_overscan=1 378 | 379 | ################################################################################ 380 | ## Framebuffer Video Settings 381 | ################################################################################ 382 | 383 | ## framebuffer_width 384 | ## Console framebuffer width in pixels. Default is display width minus 385 | ## overscan. 386 | ## 387 | #framebuffer_width=0 388 | 389 | ## framebuffer_height 390 | ## Console framebuffer height in pixels. Default is display height minus 391 | ## overscan. 392 | ## 393 | #framebuffer_height=0 394 | 395 | ## framebuffer_depth 396 | ## Console framebuffer depth in bits per pixel. 397 | ## 398 | ## Value Description 399 | ## ------------------------------------------------------------------------- 400 | ## 8 Valid, but default RGB palette makes an unreadable screen 401 | ## 16 (Default) 402 | ## 24 Looks better but has corruption issues as of 2012/06/15 403 | ## 32 Has no corruption issues but needs framebuffer_ignore_alpha=1 404 | ## and shows the wrong colors as of 2012/06/15 405 | ## 406 | #framebuffer_depth=16 407 | 408 | ## framebuffer_ignore_alpha 409 | ## Set to 1 to disable alpha channel. Helps with 32bit. 410 | ## 411 | ## Value Description 412 | ## ------------------------------------------------------------------------- 413 | ## 0 Enable Alpha Channel (Default) 414 | ## 1 Disable Alpha Channel 415 | ## 416 | #framebuffer_ignore_alpha=0 417 | 418 | ################################################################################ 419 | ## General Video Settings 420 | ################################################################################ 421 | 422 | ## display_rotate 423 | ## Rotate the display clockwise or flip the display. 424 | ## The 90 and 270 degrees rotation options require additional memory on GPU, 425 | ## so won't work with the 16M GPU split. 426 | ## 427 | ## Value Description 428 | ## ------------------------------------------------------------------------- 429 | ## 0 0 degrees (Default) 430 | ## 1 90 degrees 431 | ## 2 180 degrees 432 | ## 3 270 degrees 433 | ## 0x10000 Horizontal flip 434 | ## 0x20000 Vertical flip 435 | ## 436 | #display_rotate=0 437 | 438 | ## dispmanx_offline 439 | ## Set to "1" to enable offline compositing 440 | ## 441 | ## Default 0 442 | ## 443 | #dispmanx_offline=0 444 | 445 | ################################################################################ 446 | ## Licensed Codecs 447 | ## 448 | ## Hardware decoding of additional codecs can be enabled by purchasing a 449 | ## license that is locked to the CPU serial number of your Raspberry Pi. 450 | ## 451 | ## Up to 8 licenses per CODEC can be specified as a comma seperated list. 452 | ## 453 | ################################################################################ 454 | 455 | ## decode_MPG2 456 | ## License key to allow hardware MPEG-2 decoding. 457 | ## 458 | #decode_MPG2=0x12345678 459 | 460 | ## decode_WVC1 461 | ## License key to allow hardware VC-1 decoding. 462 | ## 463 | #decode_WVC1=0x12345678 464 | 465 | ################################################################################ 466 | ## Camera Settings 467 | ################################################################################ 468 | 469 | ## start_x 470 | ## Set to "1" to enable the camera module. 471 | ## 472 | ## Enabling the camera requires gpu_mem option to be specified with a value 473 | ## of at least 128. 474 | ## 475 | ## Default 0 476 | ## 477 | start_x=1 478 | 479 | ## disable_camera_led 480 | ## Turn off the red camera led when recording video or taking a still 481 | ## picture. 482 | ## 483 | ## Value Description 484 | ## ------------------------------------------------------------------------- 485 | ## 0 LED enabled (Default) 486 | ## 1 LED disabled 487 | ## 488 | #disable_camera_led=1 489 | 490 | ################################################################################ 491 | ## Test Settings 492 | ################################################################################ 493 | 494 | ## test_mode 495 | ## Enable test sound/image during boot for manufacturing test. 496 | ## 497 | ## Value Description 498 | ## ------------------------------------------------------------------------- 499 | ## 0 Disable Test Mod (Default) 500 | ## 1 Enable Test Mode 501 | ## 502 | #test_mode=0 503 | 504 | ################################################################################ 505 | ## Memory Settings 506 | ################################################################################ 507 | 508 | ## disable_l2cache 509 | ## Disable arm access to GPU's L2 cache. Needs corresponding L2 disabled 510 | ## kernel. 511 | ## 512 | ## Value Description 513 | ## ------------------------------------------------------------------------- 514 | ## 0 Enable L2 Cache (Default) 515 | ## 1 Disable L2 cache 516 | ## 517 | #disable_l2cache=0 518 | 519 | ## gpu_mem 520 | ## GPU memory allocation in MB for all board revisions. 521 | ## 522 | ## Default 64 523 | ## 524 | gpu_mem=128 525 | 526 | ## gpu_mem_256 527 | ## GPU memory allocation in MB for 256MB board revision. 528 | ## This option overrides gpu_mem. 529 | ## 530 | #gpu_mem_256=192 531 | 532 | ## gpu_mem_512 533 | ## GPU memory allocation in MB for 512MB board revision. 534 | ## This option overrides gpu_mem. 535 | ## 536 | #gpu_mem_512=448 537 | 538 | ## gpu_mem_1024 539 | ## GPU memory allocation in MB for 1024MB board revision. 540 | ## This option overrides gpu_mem. 541 | ## 542 | #gpu_mem_1024=944 543 | 544 | ## disable_pvt 545 | ## Disable adjusting the refresh rate of RAM every 500ms 546 | ## (measuring RAM temparature). 547 | ## 548 | #disable_pvt=1 549 | 550 | ################################################################################ 551 | ## CMA - Dynamic Memory Split 552 | ## 553 | ## CMA enables dynamic management of the ARM and GPU memory split at runtime. 554 | ## 555 | ## The following options need to be in cmdline.txt for CMA to work: 556 | ## coherent_pool=6M smsc95xx.turbo_mode=N 557 | ## 558 | ################################################################################ 559 | 560 | ## cma_lwm 561 | ## When GPU has less than cma_lwm (low water mark) memory available it 562 | ## will request some from ARM. 563 | ## 564 | #cma_lwm=16 565 | 566 | ## cma_hwm 567 | ## When GPU has more than cma_hwm (high water mark) memory available it 568 | ## will release some to ARM. 569 | ## 570 | #cma_hwm=32 571 | 572 | ################################################################################ 573 | ## Boot Option Settings 574 | ################################################################################ 575 | 576 | ## disable_commandline_tags 577 | ## Stop start.elf from filling in ATAGS (memory from 0x100) before 578 | ## launching kernel 579 | ## 580 | #disable_commandline_tags=0 581 | 582 | ## cmdline (string) 583 | ## Command line parameters. Can be used instead of cmdline.txt file 584 | ## 585 | #cmdline="" 586 | 587 | ## kernel (string) 588 | ## Alternative name to use when loading kernel. 589 | ## 590 | #kernel="" 591 | 592 | ## kernel_address 593 | ## Address to load kernel.img file at 594 | ## 595 | #kernel_address=0x00000000 596 | 597 | ## kernel_old 598 | ## Support loading old kernels 599 | ## 600 | ## Value Description 601 | ## ------------------------------------------------------------------------- 602 | ## 0 Disabled (Default) 603 | ## 1 Load kernel at address 0x00000000 604 | ## 605 | #kernel_old=1 606 | 607 | ## ramfsfile (string) 608 | ## ramfs file to load 609 | ## 610 | #ramfsfile="" 611 | 612 | ## ramfsaddr 613 | ## Address to load ramfs file at 614 | ## 615 | #ramfsaddr=0x00000000 616 | 617 | ## initramfs (string address) 618 | ## ramfs file and address to load it at (it's like ramfsfile+ramfsaddr in 619 | ## one option). 620 | ## 621 | ## NOTE: this option uses different syntax than all other options - you 622 | ## should not use "=" character here. 623 | ## 624 | #initramfs initramf.gz 0x00800000 625 | 626 | ## device_tree_address 627 | ## Address to load device_tree at 628 | ## 629 | #device_tree_address=0x00000000 630 | 631 | ## init_uart_baud 632 | ## Initial uart baud rate. 633 | ## 634 | ## Default 115200 635 | ## 636 | ## uart baud must be 38400 as per https://github.com/UbiquityRobotics/ubiquity_motor/issues/154 637 | #init_uart_baud=38400 638 | 639 | ## init_uart_clock 640 | ## Initial uart clock. 641 | ## 642 | ## Default 3000000 (3MHz) 643 | ## 644 | #init_uart_clock=3000000 645 | 646 | ## init_emmc_clock 647 | ## Initial emmc clock, increasing this can speedup your SD-card. 648 | ## 649 | ## Default 100000000 (100mhz) 650 | ## 651 | #init_emmc_clock=100000000 652 | 653 | ## boot_delay 654 | ## Wait for a given number of seconds in start.elf before loading 655 | ## kernel.img. 656 | ## 657 | ## delay = (1000 * boot_delay) + boot_delay_ms 658 | ## 659 | ## Default 1 660 | ## 661 | #boot_delay=2 662 | 663 | ## boot_delay_ms 664 | ## Wait for a given number of milliseconds in start.elf before loading 665 | ## kernel.img. 666 | ## 667 | ## delay = (1000 * boot_delay) + boot_delay_ms 668 | ## 669 | ## Default 0 670 | ## 671 | #boot_delay_ms=0 672 | 673 | ## avoid_safe_mode 674 | ## Adding a jumper between pins 5 & 6 of P1 enables a recovery Safe Mode. 675 | ## If pins 5 & 6 are used for connecting to external devices (e.g. GPIO), 676 | ## then this setting can be used to ensure Safe Mode is not triggered. 677 | ## 678 | ## Value Description 679 | ## ------------------------------------------------------------------------- 680 | ## 0 Respect Safe Mode input (Default) 681 | ## 1 Ignore Safe Mode input 682 | ## 683 | #avoid_safe_mode=1 684 | 685 | ## disable_splash 686 | ## Avoids the rainbow splash screen on boot. 687 | ## 688 | ## Value Description 689 | ## ------------------------------------------------------------------------- 690 | ## 0 Splash screen enabled (Default) 691 | ## 1 Splash screen disabled 692 | ## 693 | #disable_splash=1 694 | 695 | ################################################################################ 696 | ## Overclocking Settings 697 | ## 698 | ## ARM, SDRAM and GPU each have their own PLLs and can have unrelated 699 | ## frequencies. 700 | ## 701 | ## The GPU core, h264, v3d and isp share a PLL, so need to have related 702 | ## frequencies. 703 | ## pll_freq = floor(2400 / (2 * core_freq)) * (2 * core_freq) 704 | ## gpu_freq = pll_freq / [even number] 705 | ## 706 | ## The effective gpu_freq is automatically rounded to nearest even integer, so 707 | ## asking for core_freq = 500 and gpu_freq = 300 will result in divisor of 708 | ## 2000/300 = 6.666 => 6 and so 333.33MHz. 709 | ## 710 | ## 711 | ## Standard Profiles: 712 | ## arm_freq core_freq sdram_freq over_voltage 713 | ## ------------------------------------------------------------------------- 714 | ## None 700 250 400 0 715 | ## Modest 800 300 400 0 716 | ## Medium 900 333 450 2 717 | ## High 950 450 450 6 718 | ## Turbo 1000 500 500 6 719 | ## 720 | ################################################################################ 721 | 722 | ## force_turbo 723 | ## Control the kernel "ondemand" governor. It has no effect if no overclock 724 | ## settings are specified. 725 | ## May set warrany bit. 726 | ## 727 | ## Value Description 728 | ## ------------------------------------------------------------------------- 729 | ## 0 Enable dynamic clocks and voltage for the ARM core, GPU core and 730 | ## SDRAM (Default). 731 | ## Overclocking of h264_freq, v3d_freq and isp_freq is ignored. 732 | ## 1 Disable dynamic clocks and voltage for the ARM core, GPU core 733 | ## and SDRAM. 734 | ## Overclocking of h264_freq, v3d_freq and isp_freq is allowed. 735 | ## 736 | #force_turbo=0 737 | 738 | ## initial_turbo 739 | ## Enables turbo mode from boot for the given value in seconds (up to 60) 740 | ## or until cpufreq sets a frequency. Can help with sdcard corruption if 741 | ## overclocked. 742 | ## 743 | ## Default 0 744 | ## 745 | #initial_turbo=0 746 | 747 | ## temp_limit 748 | ## Overheat protection. Sets clocks and voltages to default when the SoC 749 | ## reaches this Celsius value. 750 | ## Setting this higher than default voids warranty. 751 | ## 752 | ## Default 85 753 | ## 754 | #temp_limit=85 755 | 756 | ## arm_freq 757 | ## Frequency of ARM in MHz. 758 | ## 759 | ## Default 700. 760 | ## 761 | #arm_freq=700 762 | 763 | ## arm_freq_min 764 | ## Minimum frequency of ARM in MHz (used for dynamic clocking). 765 | ## 766 | ## Default 700. 767 | ## 768 | #arm_freq_min=700 769 | 770 | ## gpu_freq 771 | ## Sets core_freq, h264_freq, isp_freq, v3d_freq together. 772 | ## 773 | ## Default 250. 774 | ## 775 | #gpu_freq=250 776 | 777 | ## core_freq 778 | ## Frequency of GPU processor core in MHz. It has an impact on ARM 779 | ## performance since it drives L2 cache. 780 | ## 781 | ## Default 250. 782 | ## 783 | #core_freq=250 784 | 785 | ## core_freq_min 786 | ## Minimum frequency of GPU processor core in MHz (used for dynamic 787 | ## clocking). It has an impact on ARM performance since it drives L2 cache. 788 | ## 789 | ## Default 250. 790 | ## 791 | #core_freq_min=250 792 | 793 | ## h264_freq 794 | ## Frequency of hardware video block in MHz. 795 | ## 796 | ## Default 250. 797 | ## 798 | #h264_freq=250 799 | 800 | ## isp_freq 801 | ## Frequency of image sensor pipeline block in MHz. 802 | ## 803 | ## Default 250. 804 | ## 805 | #isp_freq=250 806 | 807 | ## v3d_freq 808 | ## Frequency of 3D block in MHz. 809 | ## 810 | ## Default 250. 811 | ## 812 | #v3d_freq=250 813 | 814 | ## sdram_freq 815 | ## Frequency of SDRAM in MHz. 816 | ## 817 | ## Default 400. 818 | ## 819 | #sdram_freq=400 820 | 821 | ## sdram_freq_min 822 | ## Minimum frequency of SDRAM in MHz (used for dynamic clocking). 823 | ## 824 | ## Default 400. 825 | ## 826 | #sdram_freq_min=400 827 | 828 | ## avoid_pwm_pll 829 | ## Don't dedicate a pll to PWM audio. This will reduce analogue audio 830 | ## quality slightly. The spare PLL allows the core_freq to be set 831 | ## independently from the rest of the gpu allowing more control over 832 | ## overclocking. 833 | ## 834 | ## Value Description 835 | ## ------------------------------------------------------------------------- 836 | ## 0 Linked core_freq (Default) 837 | ## 1 Unlinked core_freq 838 | ## 839 | #avoid_pwm_pll=1 840 | 841 | ################################################################################ 842 | ## Voltage Settings 843 | ################################################################################ 844 | 845 | ## current_limit_override 846 | ## Disables SMPS current limit protection. Can help if you are currently 847 | ## hitting a reboot failure when overclocking too high. 848 | ## May set warrany bit. 849 | ## 850 | #current_limit_override=0x5A000020 851 | 852 | ## over_voltage 853 | ## ARM/GPU core voltage adjust. 854 | ## May set warrany bit. 855 | ## 856 | ## Value Description 857 | ## ------------------------------------------------------------------------- 858 | ## -16 0.8 V 859 | ## -15 0.825 V 860 | ## -14 0.85 V 861 | ## -13 0.875 V 862 | ## -12 0.9 V 863 | ## -11 0.925 V 864 | ## -10 0.95 V 865 | ## -9 0.975 V 866 | ## -8 1.0 V 867 | ## -7 1.025 V 868 | ## -6 1.05 V 869 | ## -5 1.075 V 870 | ## -4 1.1 V 871 | ## -3 1.125 V 872 | ## -2 1.15 V 873 | ## -1 1.175 V 874 | ## 0 1.2 V (Default) 875 | ## 1 1.225 V 876 | ## 2 1.25 V 877 | ## 3 1.275 V 878 | ## 4 1.3 V 879 | ## 5 1.325 V 880 | ## 6 1.35 V 881 | ## 7 1.375 V (requires force_turbo=1 or current_limit_override) 882 | ## 8 1.4 V (requires force_turbo=1 or current_limit_override) 883 | ## 884 | #over_voltage=0 885 | 886 | ## over_voltage_min 887 | ## Minimum ARM/GPU core voltage adjust (used for dynamic clocking). 888 | ## 889 | ## Value Description 890 | ## ------------------------------------------------------------------------- 891 | ## -16 0.8 V 892 | ## -15 0.825 V 893 | ## -14 0.85 V 894 | ## -13 0.875 V 895 | ## -12 0.9 V 896 | ## -11 0.925 V 897 | ## -10 0.95 V 898 | ## -9 0.975 V 899 | ## -8 1.0 V 900 | ## -7 1.025 V 901 | ## -6 1.05 V 902 | ## -5 1.075 V 903 | ## -4 1.1 V 904 | ## -3 1.125 V 905 | ## -2 1.15 V 906 | ## -1 1.175 V 907 | ## 0 1.2 V (Default) 908 | ## 1 1.225 V 909 | ## 2 1.25 V 910 | ## 3 1.275 V 911 | ## 4 1.3 V 912 | ## 5 1.325 V 913 | ## 6 1.35 V 914 | ## 7 1.375 V (requires force_turbo=1) 915 | ## 8 1.4 V (requires force_turbo=1) 916 | ## 917 | #over_voltage_min=0 918 | 919 | ## over_voltage_sdram 920 | ## Sets over_voltage_sdram_c, over_voltage_sdram_i, over_voltage_sdram_p 921 | ## together 922 | ## 923 | ## Value Description 924 | ## ------------------------------------------------------------------------- 925 | ## -16 0.8 V 926 | ## -15 0.825 V 927 | ## -14 0.85 V 928 | ## -13 0.875 V 929 | ## -12 0.9 V 930 | ## -11 0.925 V 931 | ## -10 0.95 V 932 | ## -9 0.975 V 933 | ## -8 1.0 V 934 | ## -7 1.025 V 935 | ## -6 1.05 V 936 | ## -5 1.075 V 937 | ## -4 1.1 V 938 | ## -3 1.125 V 939 | ## -2 1.15 V 940 | ## -1 1.175 V 941 | ## 0 1.2 V (Default) 942 | ## 1 1.225 V 943 | ## 2 1.25 V 944 | ## 3 1.275 V 945 | ## 4 1.3 V 946 | ## 5 1.325 V 947 | ## 6 1.35 V 948 | ## 7 1.375 V 949 | ## 8 1.4 V 950 | ## 951 | #over_voltage_sdram=0 952 | 953 | ## over_voltage_sdram_c 954 | ## SDRAM controller voltage adjust. 955 | ## 956 | ## Value Description 957 | ## ------------------------------------------------------------------------- 958 | ## -16 0.8 V 959 | ## -15 0.825 V 960 | ## -14 0.85 V 961 | ## -13 0.875 V 962 | ## -12 0.9 V 963 | ## -11 0.925 V 964 | ## -10 0.95 V 965 | ## -9 0.975 V 966 | ## -8 1.0 V 967 | ## -7 1.025 V 968 | ## -6 1.05 V 969 | ## -5 1.075 V 970 | ## -4 1.1 V 971 | ## -3 1.125 V 972 | ## -2 1.15 V 973 | ## -1 1.175 V 974 | ## 0 1.2 V (Default) 975 | ## 1 1.225 V 976 | ## 2 1.25 V 977 | ## 3 1.275 V 978 | ## 4 1.3 V 979 | ## 5 1.325 V 980 | ## 6 1.35 V 981 | ## 7 1.375 V 982 | ## 8 1.4 V 983 | ## 984 | #over_voltage_sdram_c=0 985 | 986 | ## over_voltage_sdram_i 987 | ## SDRAM I/O voltage adjust. 988 | ## 989 | ## Value Description 990 | ## ------------------------------------------------------------------------- 991 | ## -16 0.8 V 992 | ## -15 0.825 V 993 | ## -14 0.85 V 994 | ## -13 0.875 V 995 | ## -12 0.9 V 996 | ## -11 0.925 V 997 | ## -10 0.95 V 998 | ## -9 0.975 V 999 | ## -8 1.0 V 1000 | ## -7 1.025 V 1001 | ## -6 1.05 V 1002 | ## -5 1.075 V 1003 | ## -4 1.1 V 1004 | ## -3 1.125 V 1005 | ## -2 1.15 V 1006 | ## -1 1.175 V 1007 | ## 0 1.2 V (Default) 1008 | ## 1 1.225 V 1009 | ## 2 1.25 V 1010 | ## 3 1.275 V 1011 | ## 4 1.3 V 1012 | ## 5 1.325 V 1013 | ## 6 1.35 V 1014 | ## 7 1.375 V 1015 | ## 8 1.4 V 1016 | ## 1017 | #over_voltage_sdram_i=0 1018 | 1019 | ## over_voltage_sdram_p 1020 | ## SDRAM phy voltage adjust. 1021 | ## 1022 | ## Value Description 1023 | ## ------------------------------------------------------------------------- 1024 | ## -16 0.8 V 1025 | ## -15 0.825 V 1026 | ## -14 0.85 V 1027 | ## -13 0.875 V 1028 | ## -12 0.9 V 1029 | ## -11 0.925 V 1030 | ## -10 0.95 V 1031 | ## -9 0.975 V 1032 | ## -8 1.0 V 1033 | ## -7 1.025 V 1034 | ## -6 1.05 V 1035 | ## -5 1.075 V 1036 | ## -4 1.1 V 1037 | ## -3 1.125 V 1038 | ## -2 1.15 V 1039 | ## -1 1.175 V 1040 | ## 0 1.2 V (Default) 1041 | ## 1 1.225 V 1042 | ## 2 1.25 V 1043 | ## 3 1.275 V 1044 | ## 4 1.3 V 1045 | ## 5 1.325 V 1046 | ## 6 1.35 V 1047 | ## 7 1.375 V 1048 | ## 8 1.4 V 1049 | ## 1050 | #over_voltage_sdram_p=0 1051 | 1052 | ################################################################################ 1053 | ## USB Power 1054 | ################################################################################ 1055 | 1056 | ## max_usb_current 1057 | ## When set to 1, change the output current limit (for all 4 USB 1058 | ## ports combined) from 600mA to double that, 1200mA. 1059 | ## 1060 | ## This option is not available for Model A/B boards. 1061 | ## 1062 | ## Default 0. 1063 | ## 1064 | #max_usb_current=0 1065 | 1066 | ################################################################################ 1067 | ## Base Device Tree Parameters 1068 | ################################################################################ 1069 | 1070 | ## audio 1071 | ## Enable the onboard ALSA audio (loads snd_bcm2835) 1072 | ## 1073 | ## Default off. 1074 | ## 1075 | dtparam=audio=on 1076 | 1077 | ## i2c_arm 1078 | ## Enable the ARM's i2c interface 1079 | ## 1080 | ## Default off. 1081 | ## 1082 | dtparam=i2c_arm=on 1083 | 1084 | ## i2c_vc 1085 | ## Enable the i2c interface 1086 | ## 1087 | ## Usually reserved for the VideoCore processor 1088 | ## 1089 | ## Default off. 1090 | ## 1091 | #dtparam=i2c_vc=off 1092 | 1093 | ## i2c_arm_baudrate 1094 | ## Set the baudrate of the ARM's i2c interface 1095 | ## 1096 | ## Default 100000. 1097 | ## 1098 | #dtparam=i2c_arm_baudrate=100000 1099 | 1100 | ## i2c_vc_baudrate 1101 | ## Set the baudrate of the VideoCore i2c interface 1102 | ## 1103 | ## Default 100000. 1104 | ## 1105 | #dtparam=i2c_vc_baudrate=100000 1106 | 1107 | ## i2s 1108 | ## Set to "on" to enable the i2s interface 1109 | ## 1110 | ## Default off. 1111 | ## 1112 | #dtparam=i2s=off 1113 | 1114 | ## spi 1115 | ## Set to "on" to enable the spi interfaces 1116 | ## 1117 | ## Default off. 1118 | ## 1119 | #dtparam=spi=off 1120 | 1121 | ## random 1122 | ## Set to "on" to enable the hardware random 1123 | ## 1124 | ## Default off. 1125 | ## 1126 | #dtparam=random=off 1127 | 1128 | ## uart0 1129 | ## Set to "off" to disable uart0 1130 | ## 1131 | ## Default on. 1132 | ## 1133 | #dtparam=uart0=on 1134 | 1135 | ## watchdog 1136 | ## Set to "on" to enable the hardware watchdog 1137 | ## 1138 | ## Default off. 1139 | ## 1140 | #dtparam=watchdog=off 1141 | 1142 | ## act_led_trigger 1143 | ## Choose which activity the LED tracks. 1144 | ## 1145 | ## Use "heartbeat" for a nice load indicator. 1146 | ## 1147 | ## Default mmc. 1148 | ## 1149 | #dtparam=act_led_trigger=mmc 1150 | 1151 | ## act_led_activelow 1152 | ## Set to "on" to invert the sense of the LED 1153 | ## 1154 | ## Default off. 1155 | ## 1156 | #dtparam=act_led_activelow=off 1157 | 1158 | ## act_led_gpio 1159 | ## Set which GPIO to use for the activity LED 1160 | ## 1161 | ## In case you want to connect it to an external device 1162 | ## 1163 | ## Default 16 on a non-Plus board, 47 on a Plus or Pi 2. 1164 | ## 1165 | #dtparam=act_led_gpio=47 1166 | 1167 | ## pwr_led_trigger 1168 | ## Choose which activity the LED tracks. 1169 | ## 1170 | ## Use "heartbeat" for a nice load indicator. 1171 | ## 1172 | ## Not available on Model A/B boards. 1173 | ## 1174 | ## Default mmc. 1175 | ## 1176 | #dtparam=pwr_led_trigger=mmc 1177 | 1178 | ## pwr_led_activelow 1179 | ## Set to "on" to invert the sense of the LED 1180 | ## 1181 | ## Not available on Model A/B boards. 1182 | ## 1183 | ## Default off. 1184 | ## 1185 | #dtparam=pwr_led_activelow=off 1186 | 1187 | ## pwr_led_gpio 1188 | ## Set which GPIO to use for the PWR LED 1189 | ## 1190 | ## In case you want to connect it to an external device 1191 | ## 1192 | ## Not available on Model A/B boards. 1193 | ## 1194 | ## Default 35. 1195 | ## 1196 | #dtparam=pwr_led_gpio=35 1197 | 1198 | # Uncomment this to enable the lirc-rpi module 1199 | #dtoverlay=lirc-rpi 1200 | 1201 | # disable rainbow splash screen for faster booting 1202 | disable_splash=1 1203 | 1204 | # Uncomment this to enable the lirc-rpi module dtoverlay=lirc-rpi Additional overlays and parameters are documented 1205 | # /boot/overlays/README Allow UART and Bluetooth at the same time 1206 | # https://github.com/UbiquityRobotics/ubiquity_main/issues/126#issuecomment-429993821 1207 | dtoverlay=disable-bt 1208 | dtoverlay=uart2 1209 | #enable_uart=1 1210 | 1211 | dtoverlay=i2c-gpio,i2c_gpio_sda=2,i2c_gpio_scl=3,bus=1 core_freq=250 1212 | #dtoverlay=i2c-rtc,mcp7940x 1213 | #dtoverlay=ubiquity-led-buttons 1214 | 1215 | # Disable the PWR LED 1216 | dtparam=pwr_led_trigger=none 1217 | dtparam=pwr_led_activelow=off 1218 | 1219 | # Disable the Activity LED 1220 | dtparam=act_led_trigger=none 1221 | dtparam=act_led_activelow=off 1222 | 1223 | # Disable ethernet port LEDs 1224 | dtparam=eth_led0=4 1225 | dtparam=eth_led1=4 1226 | -------------------------------------------------------------------------------- /tuna_bringup/config_scripts/env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ip=$(hostname -I | cut --delimiter " " --fields 1) 4 | 5 | while [ -z $ip ] 6 | do 7 | sleep 1 8 | ip=$(hostname -I | cut --delimiter " " --fields 1) 9 | done 10 | 11 | #export ROS_IP=192.168.1.14 12 | #export ROS_HOSTNAME=$(hostname).local 13 | #export ROS_MASTER_URI=http://$ROS_HOSTNAME:11311 14 | 15 | export ROS_IP="$(echo $ip | xargs)" 16 | export ROS_HOSTNAME=$ROS_IP 17 | export ROS_MASTER_URI=http://$ROS_HOSTNAME:11311 18 | -------------------------------------------------------------------------------- /tuna_bringup/config_scripts/magni-base: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function log() { 4 | logger -s -p user.$1 ${@:2} 5 | } 6 | 7 | log info "magni-base: Using workspace setup file /home/ubuntu/catkin_ws/devel/setup.bash" 8 | source /home/ubuntu/catkin_ws/devel/setup.bash 9 | 10 | log_path="/tmp" 11 | if [[ ! -d $log_path ]]; then 12 | CREATED_LOGDIR=true 13 | trap 'CREATED_LOGDIR=false' ERR 14 | log warn "magni-base: The log directory you specified \"$log_path\" does not exist. Attempting to create." 15 | mkdir -p $log_path 2>/dev/null 16 | chown ubuntu:ubuntu $log_path 2>/dev/null 17 | chmod ug+wr $log_path 2>/dev/null 18 | trap - ERR 19 | # if log_path could not be created, default to tmp 20 | if [[ $CREATED_LOGDIR == false ]]; then 21 | log warn "magni-base: The log directory you specified \"$log_path\" cannot be created. Defaulting to \"/tmp\"!" 22 | log_path="/tmp" 23 | fi 24 | fi 25 | 26 | # GNSS SETUP 27 | stty -F /dev/ttyAMA0 9600 raw 28 | 29 | #Set RATE to 5Hz 30 | echo -e -n '\xB5\x62\x06\x08\x06\x00\xC8\x00\x01\x00\x01\x00\xDE\x6A\xB5\x62\x06\x08\x00\x00\x0E\x30' >> /dev/ttyAMA0 31 | 32 | #Set BAUD to 57600 33 | echo -e -n '\xB5\x62\x06\x00\x14\x00\x01\x00\x00\x00\xC0\x08\x00\x00\x00\xE1\x00\x00\x07\x00\x03\x00\x00\x00\x00\x00\xCE\xC9\xB5\x62\x06\x00\x00\x00\x06\x18' >> /dev/ttyAMA0 34 | 35 | stty -F /dev/ttyAMA0 57600 raw 36 | 37 | 38 | # disable hdmi (saves 30mA) 39 | sudo /opt/vc/bin/tvservice -o 40 | 41 | # disable usb controller (saves 100mA) 42 | echo '1-1' |sudo tee /sys/bus/usb/drivers/usb/unbind 43 | 44 | source /etc/ubiquity/env.sh 45 | log info "magni-base: Launching ROS_HOSTNAME=$ROS_HOSTNAME, ROS_IP=$ROS_IP, ROS_MASTER_URI=$ROS_MASTER_URI, ROS_LOG_DIR=$log_path" 46 | rosclean purge -y 47 | 48 | # Punch it. 49 | export ROS_HOME=$(echo ~ubuntu)/.ros 50 | export ROS_LOG_DIR=$log_path 51 | roslaunch --wait -v tuna_bringup core.launch 52 | PID=$! 53 | 54 | log info "magni-base: Started roslaunch as background process, PID $PID, ROS_LOG_DIR=$ROS_LOG_DIR" 55 | echo "$PID" > $log_path/magni-base.pid 56 | wait "$PID" 57 | -------------------------------------------------------------------------------- /tuna_bringup/config_scripts/ros_setup.bash: -------------------------------------------------------------------------------- 1 | source /opt/ros/noetic/setup.bash 2 | source /home/ubuntu/iris_lama_ws/devel/setup.bash 3 | source /home/ubuntu/catkin_ws/devel/setup.bash 4 | source /etc/ubiquity/env.sh 5 | -------------------------------------------------------------------------------- /tuna_bringup/config_scripts/ros_setup.sh: -------------------------------------------------------------------------------- 1 | ./opt/ros/noetic/setup.sh 2 | ./home/ubuntu/iris_lama_ws/devel/setup.sh 3 | ./home/ubuntu/catkin_ws/devel/setup.sh 4 | ./etc/ubiquity/env.sh 5 | -------------------------------------------------------------------------------- /tuna_bringup/config_scripts/roscore: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /opt/ros/noetic/setup.sh 4 | source /etc/ubiquity/env.sh 5 | 6 | while ! ping -c 1 -n -w 1 "$ROS_IP" &> /dev/null 7 | do 8 | sleep 1 9 | done 10 | 11 | roscore -v & 12 | 13 | while ! echo exit | nc localhost 11311 > /dev/null 14 | do 15 | sleep 1 16 | done 17 | -------------------------------------------------------------------------------- /tuna_bringup/config_scripts/roscore.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | After=NetworkManager.service time-sync.target 3 | [Service] 4 | Type=forking 5 | User=ubuntu 6 | ExecStart=/usr/sbin/roscore 7 | [Install] 8 | WantedBy=multi-user.target 9 | -------------------------------------------------------------------------------- /tuna_bringup/launch/core.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tuna_bringup/launch/gnss.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /tuna_bringup/launch/imu.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /tuna_bringup/package.xml: -------------------------------------------------------------------------------- 1 | 2 | tuna_bringup 3 | 0.1.0 4 | Karl launch nodes. 5 | 6 | Vid Rijavec 7 | 8 | Vid Rijavec 9 | 10 | MIT 11 | 12 | catkin 13 | 14 | std_msgs 15 | sensor_msgs 16 | 17 | message_generation 18 | message_runtime 19 | 20 | message_runtime 21 | rospy 22 | 23 | 24 | -------------------------------------------------------------------------------- /tuna_bringup/param/hyb_slam2d.yaml: -------------------------------------------------------------------------------- 1 | # LaMa - A Localization and Mapping library. 2 | # 3 | # Hybrid Particle Filter SLAM 4 | # Gridd + Landmarks 5 | # 6 | 7 | # The global frame 8 | global_frame_id: "map" 9 | # The odometry frame 10 | odom_frame_id: "odom" 11 | # The frame of the robot 12 | base_frame_id: "base_link" 13 | 14 | # Topics 15 | detection_topic: "fiducial_transforms" 16 | scan_topic: "scan_filtered" 17 | gnss_topic: "gnss/fix" 18 | 19 | # How many seconds ahead of time is the pose transformation published. 20 | transform_tolerance: 0.1 21 | 22 | # Time period (in seconds) between each time the map is published. 23 | map_publish_period: 5 24 | 25 | # You can define an initial pose 26 | # x-coordinate (meter) 27 | initial_pos_x: 0.0 28 | # y-coordinate (meter) 29 | initial_pos_y: 0.0 30 | # angular orientation (radians) 31 | initial_pos_a: 0.0 32 | 33 | # The user can trigger a map reset, which will delete the current map and start 34 | # anew. However, the current pose of the robot will remain unchanged, unless 35 | # you set this parameter to `true. If that is the case, the pose of the robot 36 | # will bet set to the initial pose. 37 | reset_initial_pose: true 38 | 39 | # Number of particles 40 | # 41 | # Increasing the number of particles increases the changes of having a better 42 | # map. But as the number of particles grow, so does the computational 43 | # requirements. 44 | # 45 | # However, the number of particles in our particle filter is not fixed. 46 | # Depending on how spread the particles are, then number can increase or 47 | # decrease. Therefore, you can set a minimum and a maximum number of particles. 48 | # 49 | 50 | # minumum number of particles 51 | particles: 10 52 | # maximum number of particles 53 | max_particles: 15 54 | 55 | # use gnss injection, useful when using a low number of particle 56 | gnss_injection: true 57 | # how likely a gnss particle will be injected (0.01 is 1%) 58 | gnss_injection_prob: 0.99 59 | 60 | # keep a history of the particle poses. 61 | # if set to true, a path will be available at the topic `/path` 62 | keep_pose_history: false 63 | 64 | # Likelihood gain 65 | # 66 | # The gain reduces or increases the difference between the weight of each 67 | # particle. Becase the number of detected landmarks is usually low, we use the 68 | # gain to amplify the difference between particles. 69 | lgain: 2.0 70 | 71 | # Do a compatibility test between the measurement and the associated landmarks. 72 | # 73 | # An incompatible measurement will not be updated but its weight will be added 74 | # to the particle weight. The objective is to penalize particles far from the 75 | # true location. 76 | ctest: true 77 | 78 | # A measurement must have a score greater than this value, otherwise it is discarded. 79 | # This prevents bad detections from being integrated. 80 | min_score: 0.5 81 | 82 | # Sampling variance factors: srr, stt, srt, str 83 | # 84 | # These factors are use to calculate the error variances from the robot motion. 85 | # The translation and rotation variances are proportional to the magnitude of 86 | # the relative translation and relative rotation between updates. 87 | # 88 | # For robotic systems with bad odometry, high values should be used. 89 | # 90 | # How much the rotation affects the rotation 91 | srr: 0.2 92 | # How much the translation affects the translation 93 | stt: 0.4 94 | # How much the rotation affect the tranlation 95 | srt: 0.2 96 | # How much the translation affects the rotation 97 | str: 0.2 98 | 99 | # Landmark sigma scaling factor: srr, sst, ssa 100 | # 101 | # These factor are use to calculate the landmark detection covaraince. The 102 | # covariance is calculated in sherical coordinates (physics version) and then 103 | # converted to Cartesian, hence, these sigma scales appy to the spherical 104 | # components of the detection. The variances are proportional to the value of 105 | # each component. 106 | # 107 | # Factor fo rho (or range) 108 | ssr: 0.1 109 | # Factor for theta 110 | sst: 0.2 111 | # Factor for azimute 112 | ssa: 0.2 113 | 114 | # Number of working threads 115 | # 116 | # The mapping processes are independent for each particle. We take advantage of 117 | # this property to parallelize their execution. Note that doubling the number 118 | # of threads may not correspond to 2x speedup, weight normalization and 119 | # sampling are executed sequentially. 120 | threads: 4 121 | 122 | # displacement threshold: The SLAM process will only update new measurements if 123 | # the robot has moved at least this many meters. 124 | # 125 | # It is recommended to use a small number here, specially if your odometry is 126 | # not to be trusted. Odometry error is cumulative, hence the more displacement 127 | # you accumulate, the higher is the error that has to be corrected. 128 | # 129 | # Remember that a smaller number also implies a higher number of updates, 130 | # therefore, you have to take into consideration how long it takes to execute a 131 | # single update step. Our slam solution is fast, and usually a small value if 132 | # recommended. 133 | d_thresh: 0.1 134 | 135 | # angular threshold: The SLAM process will only update new measurement if 136 | # the robot has turned at least this many radians. 137 | # 138 | # Read the recommendations in `d_thresh`, they apply to this parameter. 139 | a_thresh: 0.1 140 | 141 | # Optimization strategy used by the scan matching process. 142 | # The supported stategies are: 143 | # * gn Gauss-Newton method, simple and fast: assumes monotonic cost decrease 144 | # * lm Levenberg-Marquardt method, more elaborated: may require more iterations. 145 | # 146 | # Using `gn` is a good choice. 147 | strategy: "gn" 148 | 149 | # Maximum number of iterations the optimization algorithm is allowed to 150 | # execute. 151 | max_iterations: 10 152 | 153 | # Maximum L2 (i.e. Euclidean) distance, in meters, calculated by the distance 154 | # map used for scan matching. 155 | # 156 | # Each time the occupancy map is updated, a distance map is also updated that 157 | # contains the distance of a cell to the closest occupied cell. This is done 158 | # efficiently by a dynamic distance map that tracks the changes in the 159 | # occupancy map and updates accordingly. Nonetheless, this can be an expensive 160 | # tasks if the number of changes in the occupancy grid is high and the maximum 161 | # L2 distance is also high. A high number of changes usually happen when 162 | # unknown parts of the map become known, and in SLAM this happens frequently. 163 | # 164 | # A low value makes the update step go faster, but if the value is to low the 165 | # scan matching may loose "attraction" to the "walls". A value of 0.5 meters 166 | # was found to provide good results. 167 | l2_max: 0.5 168 | 169 | # Maximum range (in meters) that a laser beam/ray can have for it to be 170 | # accepted. Any beam with a value equal or higher than this will be discarded. 171 | # 172 | # Note that the lower the range of a beam the faster the update with said beam. 173 | mrange: 80 174 | 175 | # Number of beams/rays to skip in each scan 176 | # 177 | # Useful for when you want to reduce the number of beams used in the SLAM 178 | # process. Increasing this value will result in a faster update without 179 | # necessarily losing accuracy. 180 | beam_step: 5 181 | 182 | # Size (in meters) of a truncated range. A value equal to zero means no 183 | # truncation. 184 | # 185 | # Instead of discarding beams with a high range value you can truncate it to 186 | # this value. A truncated range will not not mark any cell as occupied but it 187 | # will mark free cells along its truncated range. 188 | truncate_range: 0.0 189 | 190 | # Truncation value in meters. A value equal to zero means no truncation. 191 | # 192 | # Similar to `truncate_range`, but instead of truncating the beam before it 193 | # reaches the endpoint, it reverses the direction and truncates the beam before 194 | # reaching the origin. In practice, it will have a new origin point that 195 | # respects this truncate value. 196 | truncate: 0.0 197 | 198 | # Resolution (in meters) of the occupancy and distance grid maps. 199 | # 200 | # A higher resolution may increase the SLAM accuracy. But you should not use a 201 | # resolution that is higher that your laser' resolution. 202 | # 203 | # Remember that a higher resolution increases the overall computational 204 | # requirements. More resolution means more cells to update. 205 | resolution: 0.05 206 | 207 | # The size of a squared patch in number of cells per edge. 208 | # 209 | # The grid maps used by the SLAM process grow dynamically in size. Cells are 210 | # allocated in memory only when needed. For efficiency reasons, cells are not 211 | # allocated individually but in patches (or chunks). This value defines how 212 | # many many cells are allocated per patch. For example, for a value of 32, 213 | # enough memory is allocated to hold 32*32 cells. 214 | # 215 | # A low value results in a lower amount of allocated memory, but may result in 216 | # additional memory allocation overhead if the mapping area is large. For a 217 | # high number you have the reverse effect, low memory allocation overhead but 218 | # higher amount of allocated memory. 219 | # 220 | # For more information see: 221 | # Pedrosa et al. 2018. “A Sparse-Dense Approach for Efficient Grid Mapping.” 222 | patch_size: 32 223 | 224 | # Use lossless data compression to reduce the data hold by a patch. 225 | # 226 | # All patches will have their data compressed, except the most recently used 227 | # patched. The most recently used patched are kept uncompressed in a cache 228 | # with an LRU cache eviction strategy. 229 | # 230 | # Compression and decompression (obviously) introduce a computational overhead 231 | # to the SLAM process. However, the employed lossless algorithms are fast which 232 | # in conjuction with the cache mechanism makes this online data compression a 233 | # viable feature. 234 | use_compression: false 235 | 236 | # The size of the cache as in the number of patches it holds. 237 | # 238 | # If you set this value to low, you will notice a severe impact in the time it 239 | # takes to compute an update. Also, this value may need to change if you change the 240 | # `patch_size`. 241 | cache_size: 100 242 | 243 | # Lossless data compression algorithm used to compressed patches data. 244 | # 245 | # The supported algorithms are: 246 | # * lz4 faster compression/decompression, ratio ~ 1.75 247 | # * zstd fast compression/decompression, ratio ~ 2.5 248 | # 249 | # Usually, zstd is a good choice, it has a higher compression ratio with 250 | # reasonable speeds. 251 | compression_algorithm: "lz4" 252 | 253 | -------------------------------------------------------------------------------- /tuna_bringup/param/imu_calib.yaml: -------------------------------------------------------------------------------- 1 | SM: 2 | - 0.006233600027825646 3 | - -0.02322348961893811 4 | - -0.1149554555823807 5 | - -0.159958751734454 6 | - -0.5829640259971433 7 | - 0.05255226641545713 8 | - -0.04874668848326988 9 | - 0.04796148206690259 10 | - 0.5704982147739177 11 | bias: 12 | - 0.0001902343668135292 13 | - -0.004881553470972556 14 | - -0.001487630803464606 -------------------------------------------------------------------------------- /tuna_bringup/param/new_calib.yaml: -------------------------------------------------------------------------------- 1 | SM: 2 | - -7.500594817563565e-05 3 | - 0.001440205198329968 4 | - 0.0005316199410696564 5 | - -0.06192591826929801 6 | - -1.134322863598963 7 | - 0.1755222090601962 8 | - -0.1826766534850251 9 | - 0.07168940080625942 10 | - 0.9052431864446722 11 | bias: 12 | - -0.01300983995119539 13 | - 10.41199288779398 14 | - -0.4031587170056536 -------------------------------------------------------------------------------- /tuna_bringup/scripts/ublox.txt: -------------------------------------------------------------------------------- 1 | MON-VER - 0A 04 64 00 32 2E 30 31 20 28 37 35 33 33 31 29 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 30 30 30 38 30 30 30 30 00 00 50 52 4F 54 56 45 52 20 31 35 2E 30 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 50 53 3B 53 42 41 53 3B 47 4C 4F 3B 42 44 53 3B 51 5A 53 53 00 00 00 00 00 00 00 00 00 2 | CFG-ANT - 06 13 04 00 1B 00 F0 FD 3 | CFG-DAT - 06 06 02 00 00 00 4 | CFG-GNSS - 06 3E 2C 00 00 20 20 05 00 08 10 00 01 00 01 01 01 01 03 00 01 00 01 01 03 08 10 00 00 00 01 01 05 00 03 00 01 00 01 01 06 08 0E 00 01 00 01 01 5 | CFG-INF - 06 02 0A 00 00 00 00 00 00 00 00 00 00 00 6 | CFG-INF - 06 02 0A 00 01 00 00 00 87 87 87 87 87 87 7 | CFG-INF - 06 02 0A 00 03 00 00 00 00 00 00 00 00 00 8 | CFG-ITFM - 06 39 08 00 F3 AC 62 2D 1E 03 00 00 9 | CFG-LOGFILTER - 06 47 0C 00 01 00 00 00 00 00 00 00 00 00 00 00 10 | CFG-MSG - 06 01 08 00 0B 30 00 00 00 00 00 00 11 | CFG-MSG - 06 01 08 00 0B 33 00 00 00 00 00 00 12 | CFG-MSG - 06 01 08 00 0B 31 00 00 00 00 00 00 13 | CFG-MSG - 06 01 08 00 0B 01 00 00 00 00 00 00 14 | CFG-MSG - 06 01 08 00 21 08 00 00 00 00 00 00 15 | CFG-MSG - 06 01 08 00 0A 0B 00 00 00 00 00 00 16 | CFG-MSG - 06 01 08 00 0A 09 00 00 00 00 00 00 17 | CFG-MSG - 06 01 08 00 0A 02 00 00 00 00 00 00 18 | CFG-MSG - 06 01 08 00 0A 06 00 00 00 00 00 00 19 | CFG-MSG - 06 01 08 00 0A 07 00 00 00 00 00 00 20 | CFG-MSG - 06 01 08 00 0A 21 00 00 00 00 00 00 21 | CFG-MSG - 06 01 08 00 0A 08 00 00 00 00 00 00 22 | CFG-MSG - 06 01 08 00 01 60 00 00 00 00 00 00 23 | CFG-MSG - 06 01 08 00 01 22 00 00 00 00 00 00 24 | CFG-MSG - 06 01 08 00 01 36 00 00 00 00 00 00 25 | CFG-MSG - 06 01 08 00 01 31 00 00 00 00 00 00 26 | CFG-MSG - 06 01 08 00 01 04 00 00 00 00 00 00 27 | CFG-MSG - 06 01 08 00 01 09 00 00 00 00 00 00 28 | CFG-MSG - 06 01 08 00 01 34 00 00 00 00 00 00 29 | CFG-MSG - 06 01 08 00 01 01 00 00 00 00 00 00 30 | CFG-MSG - 06 01 08 00 01 02 00 00 00 00 00 00 31 | CFG-MSG - 06 01 08 00 01 07 00 00 00 00 00 00 32 | CFG-MSG - 06 01 08 00 01 35 00 00 00 00 00 00 33 | CFG-MSG - 06 01 08 00 01 32 00 00 00 00 00 00 34 | CFG-MSG - 06 01 08 00 01 06 00 00 00 00 00 00 35 | CFG-MSG - 06 01 08 00 01 03 00 00 00 00 00 00 36 | CFG-MSG - 06 01 08 00 01 30 00 00 00 00 00 00 37 | CFG-MSG - 06 01 08 00 01 20 00 00 00 00 00 00 38 | CFG-MSG - 06 01 08 00 01 21 00 00 00 00 00 00 39 | CFG-MSG - 06 01 08 00 01 11 00 00 00 00 00 00 40 | CFG-MSG - 06 01 08 00 01 12 00 00 00 00 00 00 41 | CFG-MSG - 06 01 08 00 02 14 00 00 00 00 00 00 42 | CFG-MSG - 06 01 08 00 02 20 00 00 00 00 00 00 43 | CFG-MSG - 06 01 08 00 0D 03 00 00 00 00 00 00 44 | CFG-MSG - 06 01 08 00 0D 01 00 00 00 00 00 00 45 | CFG-MSG - 06 01 08 00 0D 06 00 00 00 00 00 00 46 | CFG-MSG - 06 01 08 00 F0 00 01 01 01 01 01 01 47 | CFG-MSG - 06 01 08 00 F0 01 01 01 01 01 01 01 48 | CFG-MSG - 06 01 08 00 F0 02 01 01 01 01 01 01 49 | CFG-MSG - 06 01 08 00 F0 03 01 01 01 01 01 01 50 | CFG-MSG - 06 01 08 00 F0 04 01 01 01 01 01 01 51 | CFG-MSG - 06 01 08 00 F0 05 01 01 01 01 01 01 52 | CFG-MSG - 06 01 08 00 F0 06 00 00 00 00 00 00 53 | CFG-MSG - 06 01 08 00 F0 07 00 00 00 00 00 00 54 | CFG-MSG - 06 01 08 00 F0 08 00 00 00 00 00 00 55 | CFG-MSG - 06 01 08 00 F0 09 00 00 00 00 00 00 56 | CFG-MSG - 06 01 08 00 F0 0A 00 00 00 00 00 00 57 | CFG-MSG - 06 01 08 00 F0 0D 00 00 00 00 00 00 58 | CFG-MSG - 06 01 08 00 F0 0E 00 00 00 00 00 00 59 | CFG-MSG - 06 01 08 00 F0 0F 00 00 00 00 00 00 60 | CFG-MSG - 06 01 08 00 F1 00 00 00 00 00 00 00 61 | CFG-MSG - 06 01 08 00 F1 03 00 00 00 00 00 00 62 | CFG-MSG - 06 01 08 00 F1 04 00 00 00 00 00 00 63 | CFG-NAV5 - 06 24 24 00 FF FF 05 03 00 00 00 00 10 27 00 00 05 00 FA 00 FA 00 64 00 2C 01 00 3C 00 00 00 00 C8 00 00 00 00 00 00 00 64 | CFG-NAVX5 - 06 23 28 00 00 00 FF FF 5F 00 00 00 03 02 03 14 06 00 00 01 00 00 DC 06 00 00 00 00 01 01 00 00 00 64 64 00 00 01 10 00 00 00 00 00 65 | CFG-NMEA - 06 17 14 00 00 40 00 02 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 66 | CFG-ODO - 06 1E 14 00 00 00 00 00 00 00 00 00 19 46 19 66 0A 32 00 00 99 4C 00 00 67 | CFG-PM2 - 06 3B 2C 00 01 06 00 00 00 90 02 00 E8 03 00 00 10 27 00 00 00 00 00 00 00 00 00 00 2C 01 00 00 4F C1 03 00 86 02 00 00 FE 00 00 00 64 40 01 00 68 | 69 | CFG-PRT - 06 00 14 00 00 00 00 00 84 00 00 00 00 00 00 00 07 00 03 00 00 00 00 00 70 | CFG-PRT - 06 00 14 00 01 00 00 00 C0 08 00 00 00 E1 00 00 07 00 03 00 00 00 00 00 71 | CFG-PRT - 06 00 14 00 02 00 00 00 C0 38 00 00 00 00 00 00 00 00 00 00 00 00 00 00 72 | CFG-PRT - 06 00 14 00 03 00 00 00 00 00 00 00 00 00 00 00 07 00 03 00 00 00 00 00 73 | CFG-PRT - 06 00 14 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 74 | 75 | CFG-RATE - 06 08 06 00 C8 00 01 00 01 00 76 | 77 | CFG-RINV - 06 34 18 00 00 4E 6F 74 69 63 65 3A 20 6E 6F 20 64 61 74 61 20 73 61 76 65 64 21 00 78 | CFG-RXM - 06 11 02 00 08 00 79 | CFG-SBAS - 06 16 08 00 01 03 03 00 51 A2 06 00 80 | CFG-TP5 - 06 31 20 00 00 00 00 00 32 00 00 00 40 42 0F 00 40 42 0F 00 00 00 00 00 A0 86 01 00 00 00 00 00 77 00 00 00 81 | CFG-TP5 - 06 31 20 00 01 00 00 00 32 00 00 00 04 00 00 00 01 00 00 00 48 E8 01 00 A0 86 01 00 00 00 00 00 7E 00 00 00 82 | CFG-USB - 06 1B 6C 00 46 15 A8 01 00 00 00 00 64 00 22 01 75 2D 62 6C 6F 78 20 41 47 20 2D 20 77 77 77 2E 75 2D 62 6C 6F 78 2E 63 6F 6D 00 00 00 00 00 00 75 2D 62 6C 6F 78 20 47 4E 53 53 20 72 65 63 65 69 76 65 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 83 | 84 | 85 | https://portal.u-blox.com/s/question/0D52p00008HKCh8CAH/ublox-8-configuration-using-hex-commands 86 | 87 | CFG-PRT - 06 00 14 00 01 00 00 00 C0 08 00 00 00 E1 00 00 07 00 03 00 00 00 00 00 88 | 89 | echo -e -n '\xB5\x62\x06\x00\x14\x00\x01\x00\x00\x00\xC0\x08\x00\x00\x00\xE1\x00\x00\x07\x00\x03\x00\x00\x00\x00\x00\xCE\xC9' >> /dev/ttyAMA0 90 | 91 | echo -e -n '\xB5\x62 \x06\x08\x06\x00\xC8\x00\x01\x00\x01\x00\xDE\x6A \xB5\x62 \x06\x08\x00\x00 \x0E\x30' >> /dev/ttyAMA0 -------------------------------------------------------------------------------- /tuna_bringup/scripts/ubxgen.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # 3 | # ubx packet generator 4 | # 5 | # v0.1 6 | # 7 | # Wilfried Klaebe 8 | # 9 | # Usage: 10 | # 11 | # ubxgen.py 06 13 04 00 01 00 00 00 > packet.ubx 12 | # 13 | # prepends 0xb5 0x62 header, 14 | # appends checksum, 15 | # outputs binary packet to stdout 16 | # 17 | # you can send the packet to GPS chip like this: 18 | # 19 | # cat packet.ubx > /dev/ttySAC1 20 | 21 | import sys 22 | import binascii 23 | 24 | cs0=0 25 | cs1=0 26 | 27 | print("\\xb5\\x62") 28 | 29 | for d in sys.argv[1:]: 30 | c = binascii.unhexlify(d) 31 | print(c) 32 | cs0 += ord(c) 33 | cs0 &= 255 34 | cs1 += cs0 35 | cs1 &= 255 36 | 37 | print(bytes([cs0,cs1]).hex()) -------------------------------------------------------------------------------- /tuna_bringup/setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup 2 | from catkin_pkg.python_setup import generate_distutils_setup 3 | 4 | # fetch values from package.xml 5 | setup_args = generate_distutils_setup( 6 | packages=['tuna_bringup'], 7 | package_dir={'': 'nodes'}, 8 | requires=['std_msgs', 'rospy'] 9 | ) 10 | 11 | setup(**setup_args) 12 | -------------------------------------------------------------------------------- /tuna_description/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(tuna_description) 3 | 4 | find_package(catkin REQUIRED COMPONENTS 5 | roscpp 6 | rospy 7 | message_generation 8 | std_msgs 9 | ) 10 | 11 | catkin_python_setup() 12 | 13 | generate_messages(DEPENDENCIES std_msgs) 14 | 15 | catkin_package( 16 | CATKIN_DEPENDS std_msgs message_runtime 17 | ) 18 | -------------------------------------------------------------------------------- /tuna_description/img/NodeGraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoffKalast/tuna/16065bacc6a904e335cc2f3c4ec2dc8696b63499/tuna_description/img/NodeGraph.png -------------------------------------------------------------------------------- /tuna_description/img/TunaElectric.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoffKalast/tuna/16065bacc6a904e335cc2f3c4ec2dc8696b63499/tuna_description/img/TunaElectric.png -------------------------------------------------------------------------------- /tuna_description/img/TunaElectric.xml: -------------------------------------------------------------------------------- 1 | 7V1bc5vItv41rjrnwSr6wu3Rlzjj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27R/wMVgt78J4vdC3s/Q/dFfpi6xHQIsvwzVfdpHOi6Ps147Pu5oJoGC3SWDA1PY5CRnK9IAaEshIEpjNbv2n//zrPvr1M7kI3/39PP7v8hQKM9qvOIvbUJvl0PssHsPg6yL4sQqSr9M45SBxQwuMpsoufUaoKwK0yCuTHRztYa6SnAP18NWKVtx5tK6Cb2Hy6+t8vRgDTrXgFFW5KqvFawylhxe8Uo3S5GkRfH2MkmjgpbowKrTeBTuia8VpvTQ64HTAaZGaIxoJtKIUsu92C6Wzx6evKSBmd/spWHW3e1w++euEqAHxOhDPl55icYWm8H54m0EtXPkuni3un5YDSrWglAr9JsDKrpKAmr6No4zkW+tXumwP76JpmM34Hw== -------------------------------------------------------------------------------- /tuna_description/img/gazebo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoffKalast/tuna/16065bacc6a904e335cc2f3c4ec2dc8696b63499/tuna_description/img/gazebo.png -------------------------------------------------------------------------------- /tuna_description/img/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoffKalast/tuna/16065bacc6a904e335cc2f3c4ec2dc8696b63499/tuna_description/img/grid.png -------------------------------------------------------------------------------- /tuna_description/img/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoffKalast/tuna/16065bacc6a904e335cc2f3c4ec2dc8696b63499/tuna_description/img/image.png -------------------------------------------------------------------------------- /tuna_description/img/vizanti.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoffKalast/tuna/16065bacc6a904e335cc2f3c4ec2dc8696b63499/tuna_description/img/vizanti.jpg -------------------------------------------------------------------------------- /tuna_description/launch/model.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tuna_description/launch/odometry.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tuna_description/nodes/odom_publisher.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import numpy as np 4 | import rospy 5 | import time 6 | import math 7 | import tf 8 | import random 9 | 10 | from std_msgs.msg import String, Bool 11 | from nav_msgs.msg import Odometry 12 | from geometry_msgs.msg import Point, Pose, Quaternion, Twist, Vector3, TransformStamped 13 | from sensor_msgs.msg import Imu, MagneticField, JointState 14 | 15 | import tf2_ros 16 | import tf2_geometry_msgs 17 | 18 | RATE = 20.0 19 | CALIB_FACTOR = 1.55 20 | 21 | def transform_quat(orientation, tf_buffer, from_frame, to_frame): 22 | pose_stamped = tf2_geometry_msgs.PoseStamped() 23 | pose_stamped.pose.orientation = orientation 24 | pose_stamped.header.frame_id = from_frame 25 | pose_stamped.header.stamp = rospy.Time.now() 26 | 27 | try: 28 | # ** It is important to wait for the listener to start listening. Hence the rospy.Duration(1) 29 | output_pose_stamped = tf_buffer.transform(pose_stamped, to_frame, rospy.Duration(0.1)) 30 | return output_pose_stamped.pose 31 | 32 | except (tf2_ros.LookupException, tf2_ros.ConnectivityException, tf2_ros.ExtrapolationException): 33 | raise 34 | 35 | class State: 36 | def __init__(self): 37 | rospy.init_node('odometry_publisher') 38 | 39 | self.odom_tf = tf.TransformBroadcaster() 40 | 41 | self.tf_buffer = tf2_ros.Buffer() 42 | self.listener = tf2_ros.TransformListener(self.tf_buffer) 43 | 44 | self.diff_drive_sub = rospy.Subscriber("/diff_drive", JointState, self.diff_drive_data) 45 | self.imu_sub = rospy.Subscriber("/imu/data", Imu, self.imu_data) 46 | 47 | self.odom_pub = rospy.Publisher("/odometry/propeller", Odometry, queue_size=5) 48 | self.joint_pub = rospy.Publisher("/joint_states", JointState, queue_size=1) 49 | 50 | self.x = 0 51 | self.y = 0 52 | self.angle = 0 53 | 54 | self.speed = 0 55 | 56 | self.cmd_linear_speed = 0 57 | self.cmd_prop_left = 0.0 58 | self.cmd_prop_right = 0.0 59 | 60 | self.prop_left = 0.0 61 | self.prop_right = 0.0 62 | 63 | self.rotation = (0.0, 0.0, 0.0, 1.0) 64 | self.imu_angle = 0 65 | 66 | def imu_data(self, msg): 67 | quat = transform_quat(msg.orientation, self.tf_buffer, "imu_link", "base_link").orientation 68 | self.rotation = (quat.x, quat.y, quat.z, quat.w) 69 | 70 | angles = tf.transformations.euler_from_quaternion(self.rotation) 71 | self.imu_angle = angles[2] 72 | 73 | def diff_drive_data(self, msg): 74 | if math.isnan(msg.velocity[0]) or math.isnan(msg.velocity[1]): 75 | rospy.logfatal("Warning: NaN value detected in diff_drive_data: v0=%s, v1=%s", msg.velocity[0], msg.velocity[1]) 76 | else: 77 | self.cmd_linear_speed = (msg.velocity[0] + msg.velocity[1]) * 0.5 * CALIB_FACTOR 78 | self.cmd_prop_left = msg.velocity[0] 79 | self.cmd_prop_right = msg.velocity[1] 80 | 81 | def get_covariance(self, val): 82 | array = np.zeros(36) 83 | array[0] = val 84 | array[7] = val 85 | array[14] = val 86 | array[21] = val 87 | array[28] = val 88 | array[35] = val 89 | return array 90 | 91 | def publish_state(self): 92 | 93 | #slow acceleration and drifting 94 | self.speed = self.speed * 0.95 + self.cmd_linear_speed * 0.05 95 | 96 | if math.isnan(self.speed): 97 | rospy.logfatal("Warning: odometry speed is NaN") 98 | self.speed = 0.0 99 | 100 | current_time = rospy.Time.now() 101 | linearmove = self.speed * 1.0/RATE 102 | 103 | self.angle = self.imu_angle 104 | 105 | turnx = linearmove 106 | turny = 0 107 | 108 | cosang = math.cos(self.angle) 109 | sinang = math.sin(self.angle) 110 | 111 | if math.isnan(cosang) or math.isnan(sinang): 112 | rospy.logfatal("Warning: odometry angle is NaN") 113 | sinang = 0 114 | cosang = 0 115 | 116 | deltax = turnx * cosang - turny * sinang 117 | deltay = turnx * sinang + turny * cosang 118 | 119 | self.x += deltax 120 | self.y += deltay 121 | 122 | self.odom_tf.sendTransform((self.x, self.y, 0), self.rotation, current_time, "base_link", "odom") 123 | 124 | odom = Odometry() 125 | odom.header.stamp = current_time 126 | odom.header.frame_id = "odom" 127 | odom.pose.pose = Pose(Point(self.x, self.y, 0), Quaternion(self.rotation[0], self.rotation[1], self.rotation[2], self.rotation[3])) 128 | odom.pose.covariance = self.get_covariance(1.0) 129 | odom.child_frame_id = "base_link" 130 | odom.twist.twist = Twist(Vector3(self.speed, 0, 0), Vector3(0, 0, 0)) 131 | odom.twist.covariance = self.get_covariance(1.0) 132 | self.odom_pub.publish(odom) 133 | 134 | # Joint States for RViz 135 | 136 | self.prop_left += self.cmd_prop_left * 3.1 137 | self.prop_right += self.cmd_prop_left * 3.1 138 | 139 | state = JointState() 140 | state.header.stamp = current_time 141 | state.name = ["base_to_prop_left", "base_to_prop_right"] 142 | state.position = [self.prop_left , -self.prop_right] 143 | self.joint_pub.publish(state) 144 | 145 | try: 146 | state = State() 147 | r = rospy.Rate(RATE) 148 | while not rospy.is_shutdown(): 149 | state.publish_state() 150 | r.sleep() 151 | 152 | except rospy.ROSInterruptException: 153 | print("Script interrupted", file=sys.stderr) 154 | -------------------------------------------------------------------------------- /tuna_description/nodes/sim_publisher.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import numpy as np 4 | import rospy 5 | import time 6 | import math 7 | import tf 8 | 9 | from nav_msgs.msg import Odometry 10 | from geometry_msgs.msg import Point, Pose, Quaternion, Twist, Vector3, TransformStamped 11 | from sensor_msgs.msg import Imu 12 | 13 | RATE = 50.0 14 | WAVE_SPEED = 1.0 15 | WAVE_HEIGHT = 0.01 16 | 17 | def euler_to_quaternion(roll, pitch, yaw): 18 | 19 | qx = np.sin(roll/2) * np.cos(pitch/2) * np.cos(yaw/2) - np.cos(roll/2) * np.sin(pitch/2) * np.sin(yaw/2) 20 | qy = np.cos(roll/2) * np.sin(pitch/2) * np.cos(yaw/2) + np.sin(roll/2) * np.cos(pitch/2) * np.sin(yaw/2) 21 | qz = np.cos(roll/2) * np.cos(pitch/2) * np.sin(yaw/2) - np.sin(roll/2) * np.sin(pitch/2) * np.cos(yaw/2) 22 | qw = np.cos(roll/2) * np.cos(pitch/2) * np.cos(yaw/2) + np.sin(roll/2) * np.sin(pitch/2) * np.sin(yaw/2) 23 | 24 | return [qx, qy, qz, qw] 25 | 26 | #old simulator 27 | class State: 28 | def __init__(self): 29 | rospy.init_node('odometry_publisher') 30 | 31 | self.get_tf = tf.TransformListener() 32 | self.odom_tf = tf.TransformBroadcaster() 33 | 34 | self.motor_sub = rospy.Subscriber("/cmd_vel", Twist, self.motor_data) 35 | self.odom_pub = rospy.Publisher("/odom", Odometry, queue_size=50) 36 | 37 | self.x = 0 38 | self.y = 0 39 | self.angle = 0 40 | 41 | self.speed = 0 42 | self.angular_speed = 0 43 | 44 | self.CMD_speed = 0 45 | self.CMD_angular_speed = 0 46 | 47 | self.rotation = (0.0, 0.0, 0.0, 1.0) 48 | 49 | def motor_data(self, msg): 50 | self.CMD_speed = msg.linear.x * 0.85 51 | self.CMD_angular_speed = msg.angular.z 52 | 53 | def get_covariance(self, val): 54 | array = np.zeros(36) 55 | array[0] = val 56 | array[7] = val 57 | array[14] = val 58 | array[21] = val 59 | array[28] = val 60 | array[35] = val 61 | return array 62 | 63 | def publish_state(self): 64 | 65 | #slow acceleration and drifting 66 | self.angular_speed = self.angular_speed * 0.98 + self.CMD_angular_speed * 0.02 67 | self.speed = self.speed * 0.98 + self.CMD_speed * 0.02 68 | 69 | current_time = rospy.Time.now() 70 | linearmove = self.speed * 1.0/RATE 71 | 72 | self.angle += self.angular_speed * 1.0/RATE + abs(math.sin(rospy.get_time()*WAVE_SPEED)*WAVE_HEIGHT*0.2) 73 | 74 | turnx = linearmove 75 | turny = 0 76 | 77 | cosang = math.cos(self.angle) 78 | sinang = math.sin(self.angle) 79 | 80 | deltax = turnx * cosang - turny * sinang 81 | deltay = turnx * sinang + turny * cosang 82 | 83 | self.x += deltax + abs(math.sin(rospy.get_time()*WAVE_SPEED)*WAVE_HEIGHT*0.05) 84 | self.y += deltay + abs(math.sin(rospy.get_time()*WAVE_SPEED)*WAVE_HEIGHT*0.1) 85 | self.z = math.sin(rospy.get_time()*WAVE_SPEED)*WAVE_HEIGHT 86 | 87 | self.rotation = euler_to_quaternion(math.sin(rospy.get_time()*WAVE_SPEED)*WAVE_HEIGHT*10.0,math.sin(rospy.get_time()*WAVE_SPEED*1.5)*WAVE_HEIGHT*5.0,self.angle) 88 | 89 | self.odom_tf.sendTransform((self.x, self.y, self.z), self.rotation, current_time, "base_link", "odom") 90 | 91 | odom = Odometry() 92 | odom.header.stamp = current_time 93 | odom.header.frame_id = "odom" 94 | odom.pose.pose = Pose(Point(self.x, self.y, self.z), Quaternion(self.rotation[0], self.rotation[1], self.rotation[2], self.rotation[3])) 95 | odom.pose.covariance = self.get_covariance(0.5) 96 | odom.child_frame_id = "base_link" 97 | odom.twist.twist = Twist(Vector3(deltax, deltay, 0), Vector3(0, 0, self.angle)) 98 | odom.twist.covariance = self.get_covariance(0.5) 99 | self.odom_pub.publish(odom) 100 | 101 | 102 | try: 103 | state = State() 104 | r = rospy.Rate(RATE) 105 | while not rospy.is_shutdown(): 106 | state.publish_state() 107 | r.sleep() 108 | 109 | except rospy.ROSInterruptException: 110 | print("Script interrupted", file=sys.stderr) 111 | -------------------------------------------------------------------------------- /tuna_description/package.xml: -------------------------------------------------------------------------------- 1 | 2 | tuna_description 3 | 0.1.0 4 | Visual display for Karl. 5 | 6 | Vid Rijavec 7 | 8 | MIT 9 | 10 | catkin 11 | 12 | std_msgs 13 | 14 | message_generation 15 | message_runtime 16 | 17 | message_runtime 18 | rospy 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /tuna_description/setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup 2 | from catkin_pkg.python_setup import generate_distutils_setup 3 | 4 | # fetch values from package.xml 5 | setup_args = generate_distutils_setup( 6 | packages=['tuna_description'], 7 | package_dir={'': 'nodes'}, 8 | requires=['std_msgs', 'rospy'] 9 | ) 10 | 11 | setup(**setup_args) 12 | -------------------------------------------------------------------------------- /tuna_description/urdf/boat.urdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /tuna_gazebo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(tuna_gazebo) 3 | 4 | find_package(catkin REQUIRED COMPONENTS 5 | roscpp 6 | rospy 7 | message_generation 8 | std_msgs 9 | ) 10 | 11 | generate_messages(DEPENDENCIES std_msgs) 12 | 13 | catkin_package( 14 | CATKIN_DEPENDS std_msgs message_runtime 15 | ) 16 | -------------------------------------------------------------------------------- /tuna_gazebo/launch/bridge.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /tuna_gazebo/launch/ign.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tuna_gazebo/meshes/prop_left.dae: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Blender User 6 | Blender 2.90.1 commit date:2020-09-23, commit time:06:43, hash:3e85bb34d0d7 7 | 8 | 2022-09-22T01:34:37 9 | 2022-09-22T01:34:37 10 | 11 | Z_UP 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 0 0 0 1 20 | 21 | 22 | 0.8 0.8 0.8 1 23 | 24 | 25 | 1.45 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 0 0 0 1 37 | 38 | 39 | 0 0 0 1 40 | 41 | 42 | 1.45 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 0 0 0 1 54 | 55 | 56 | 0 0.01575971 0.2140349 1 57 | 58 | 59 | 1.45 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 1 0.8450995 0 1 71 | 72 | 73 | 0.8000001 0.5478113 0 1 74 | 75 | 76 | 1.45 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | -18.84557 8.266208 -7.539108 -16.82127 1.016523 0.4821085 -17.26124 -0.2838404 -0.8751246 -19.09933 6.86573 -9.015815 -16.78647 6.916718 -9.04018 -15.09333 0.9652923 0.2343032 -16.06734 -0.5871306 -0.726529 -17.65687 5.331922 -10.07062 -14.82225 4.003672 -10.65852 -13.89751 0.9075054 -0.0659182 -14.97687 -0.7286363 -0.5352949 -15.514 2.266621 -11.15546 -12.79792 0.7075318 -11.37698 -12.71125 0.8634271 -0.345284 -13.81698 -0.8093131 -0.2904644 -13.74851 -1.105052 -11.31521 -11.14513 -4.424077 -10.4996 -11.05902 0.620488 -0.6767717 -12.12597 -0.9182074 0.1198554 -12.0661 -6.07829 -9.617714 -8.755251 -8.196828 -7.89828 -9.035195 0.3255195 -0.9036175 -10.06966 -0.7877708 0.4780619 -9.45266 -9.399274 -6.42662 -18.84557 -8.266201 7.539128 -16.82127 -1.016516 -0.4820878 -17.26124 0.2838472 0.8751456 -19.09933 -6.865725 9.015836 -16.78647 -6.916711 9.0402 -15.09333 -0.9652852 -0.2342821 -16.06734 0.5871372 0.7265778 -17.65687 -5.331914 10.07064 -14.82225 -4.003665 10.65854 -13.89751 -0.9074985 0.06593906 -14.97687 0.728643 0.5353161 -15.514 -2.266614 11.15548 -12.79792 -0.707527 11.37699 -12.71125 -0.8634203 0.3453049 -13.81698 0.8093202 0.2904855 -13.74851 1.105057 11.31523 -11.14513 4.424083 10.49962 -11.05902 -0.620481 0.6767926 -12.12597 0.918214 -0.1198344 -12.0661 6.078296 9.617737 -8.755251 8.196834 7.898304 -9.035195 -0.3255125 0.9036383 -10.06966 0.7877777 -0.4780408 -9.45266 9.399282 6.426641 -22.12812 -0.9454441 -0.6439705 -22.12958 -0.279707 -1.1092 -22.12958 0.6439648 -0.945446 -22.12958 1.1092 -0.2797127 -22.12958 0.9454441 0.6439667 -22.12812 0.279707 1.1092 -22.12572 -0.6439667 0.945446 -22.12572 -1.1092 0.2797089 0.196455 -0.2750454 -1.112457 0.1979045 -0.9407806 -0.6472283 0.196455 1.113863 -0.2829704 0.196455 0.6486302 -0.9487038 0.2003154 -1.104536 0.2764511 0.2003154 -0.6393032 0.9421883 0.1979045 0.2843704 1.105942 0.196455 0.9501076 0.6407089 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | -0.362262 0.9162451 0.1710596 -0.684401 -0.7172706 0.1308373 -0.3912863 0.1476822 0.908342 -0.554627 -0.174845 -0.8135221 -0.2153726 -0.9369642 0.2751594 -0.5422905 -0.003082394 -0.8401855 0.4929509 0.7972913 -0.348319 -0.7846882 0.236496 -0.5730046 -0.534518 -0.352683 -0.768053 -0.1898625 -0.8350778 0.5163308 0.2302337 0.4375172 0.8692359 0.1550046 0.2548619 0.9544733 0.5298771 0.5744965 -0.6238462 0.5067312 -0.07547253 -0.8587942 0.5985483 0.3095898 -0.7388464 0.1943162 0.7057888 0.6812513 -0.249797 -0.5938668 0.7648031 0.1167354 -0.9728564 0.1998083 -0.2070384 -0.2627655 0.942385 -0.5862216 -0.637281 -0.5002172 0.2085363 0.9089472 0.3610092 0.7453665 0.6416628 0.1808252 0.7386379 -0.4582839 -0.4943582 0.3369558 -0.01812803 0.941346 -0.362262 -0.9162451 -0.1710596 -0.684401 0.7172706 -0.1308373 -0.3912863 -0.1476822 -0.908342 -0.554627 0.174845 0.8135221 -0.2153745 0.9369722 -0.2751312 -0.5422905 0.003082394 0.8401855 0.4929509 -0.7972913 0.348319 -0.7846882 -0.236496 0.5730046 -0.534518 0.352683 0.768053 -0.1898625 0.8350778 -0.5163308 0.2302337 -0.4375172 -0.8692359 0.1550046 -0.2548619 -0.9544733 0.5298771 -0.5744965 0.6238462 0.5067086 0.07547372 0.8588075 0.5985483 -0.3095898 0.7388464 0.1943162 -0.7057888 -0.6812513 -0.249797 0.5938668 -0.7648031 0.1167354 0.9728564 -0.1998083 -0.2070384 0.2627655 -0.942385 -0.5862216 0.637281 0.5002172 0.2085363 -0.9089472 -0.3610092 0.7453665 -0.6416628 -0.1808252 0.7386379 0.4582839 0.4943582 0.3369558 0.01812803 -0.941346 0.6303489 -0.6538794 -0.4184522 -0.6290653 -0.7589863 0.1679786 -0.6306152 -0.6547558 -0.4166767 0.629738 0.6551302 0.4174143 0.6314409 -0.4168609 0.653842 -0.6305928 0.7579199 -0.1670634 -0.6312385 0.6534874 0.4177228 -0.6288476 -0.4189062 0.6550331 0.6298933 0.1684374 0.7581976 -0.6301629 0.1664829 0.758405 -0.6307948 -0.1678844 -0.7575703 0.6316975 -0.7571336 0.1664546 0.6292794 -0.1670326 -0.7590174 0.62995 0.4180541 -0.6545181 -0.6303486 0.4176891 -0.6543673 0.6301719 0.7582023 -0.1673703 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 |

0 0 0 2 1 1 1 2 2 11 3 3 6 4 4 7 5 5 4 6 6 3 7 7 0 0 8 6 4 9 1 2 10 2 1 11 7 5 12 2 1 13 3 7 14 1 2 15 4 6 16 0 0 17 15 8 18 10 9 19 11 3 20 9 10 21 4 6 22 5 11 23 8 12 24 7 5 25 4 6 26 10 9 27 5 11 28 6 4 29 16 13 30 15 8 31 12 14 32 13 15 33 8 12 34 9 10 35 12 14 36 11 3 37 8 12 38 14 16 39 9 10 40 10 9 41 23 17 42 18 18 43 19 19 44 18 18 45 13 15 46 14 16 47 19 19 48 14 16 49 15 8 50 17 20 51 12 14 52 13 15 53 21 21 54 16 13 55 17 20 56 20 22 57 19 19 58 16 13 59 22 23 60 17 20 61 18 18 62 24 24 63 26 25 64 25 26 65 35 27 66 30 28 67 31 29 68 28 30 69 27 31 70 24 24 71 30 28 72 25 26 73 26 25 74 31 29 75 26 25 76 27 31 77 25 26 78 28 30 79 24 24 80 39 32 81 34 33 82 35 27 83 33 34 84 28 30 85 29 35 86 32 36 87 31 29 88 28 30 89 34 33 90 29 35 91 30 28 92 40 37 93 39 32 94 36 38 95 37 39 96 32 36 97 33 34 98 36 38 99 35 27 100 32 36 101 38 40 102 33 34 103 34 33 104 47 41 105 42 42 106 43 43 107 42 42 108 37 39 109 38 40 110 43 43 111 38 40 112 39 32 113 41 44 114 36 38 115 37 39 116 45 45 117 40 37 118 41 44 119 44 46 120 43 43 121 40 37 122 46 47 123 41 44 124 42 42 125 45 45 126 47 41 127 44 46 128 21 21 129 23 17 130 20 22 131 0 0 162 3 7 163 2 1 164 11 3 165 10 9 166 6 4 167 4 6 168 7 5 169 3 7 170 6 4 171 5 11 172 1 2 173 7 5 174 6 4 175 2 1 176 1 2 177 5 11 178 4 6 179 15 8 180 14 16 181 10 9 182 9 10 183 8 12 184 4 6 185 8 12 186 11 3 187 7 5 188 10 9 189 9 10 190 5 11 191 16 13 192 19 19 193 15 8 194 13 15 195 12 14 196 8 12 197 12 14 198 15 8 199 11 3 200 14 16 201 13 15 202 9 10 203 23 17 204 22 23 205 18 18 206 18 18 207 17 20 208 13 15 209 19 19 210 18 18 211 14 16 212 17 20 213 16 13 214 12 14 215 21 21 216 20 22 217 16 13 218 20 22 219 23 17 220 19 19 221 22 23 222 21 21 223 17 20 224 24 24 225 27 31 226 26 25 227 35 27 228 34 33 229 30 28 230 28 30 231 31 29 232 27 31 233 30 28 234 29 35 235 25 26 236 31 29 237 30 28 238 26 25 239 25 26 240 29 35 241 28 30 242 39 32 243 38 40 244 34 33 245 33 34 246 32 36 247 28 30 248 32 36 249 35 27 250 31 29 251 34 33 252 33 34 253 29 35 254 40 37 255 43 43 256 39 32 257 37 39 258 36 38 259 32 36 260 36 38 261 39 32 262 35 27 263 38 40 264 37 39 265 33 34 266 47 41 267 46 47 268 42 42 269 42 42 270 41 44 271 37 39 272 43 43 273 42 42 274 38 40 275 41 44 276 40 37 277 36 38 278 45 45 279 44 46 280 40 37 281 44 46 282 47 41 283 43 43 284 46 47 285 45 45 286 41 44 287 45 45 288 46 47 289 47 41 290 21 21 291 22 23 292 23 17 293

138 |
139 | 140 | 141 | 142 | 143 |

57 48 132 55 49 133 48 50 134 63 51 135 61 52 136 57 48 137 63 51 138 51 53 139 52 54 140 54 55 141 62 56 142 53 57 143 49 58 144 55 49 145 53 57 146 53 57 147 63 51 148 52 54 149 61 52 150 55 49 151 60 59 152 56 60 153 48 50 154 49 58 155 51 53 156 59 61 157 50 62 158 50 62 159 56 60 160 49 58 161 57 48 294 60 59 295 55 49 296 59 61 297 58 63 298 63 51 299 63 51 300 62 56 301 61 52 302 61 52 303 60 59 304 57 48 305 57 48 306 56 60 307 59 61 308 59 61 309 63 51 310 57 48 311 63 51 312 58 63 313 51 53 314 54 55 315 61 52 316 62 56 317 51 53 318 50 62 319 49 58 320 49 58 321 48 50 322 55 49 323 55 49 324 54 55 325 53 57 326 53 57 327 52 54 328 51 53 329 51 53 330 49 58 331 53 57 332 53 57 333 62 56 334 63 51 335 61 52 336 54 55 337 55 49 338 56 60 339 57 48 340 48 50 341 51 53 342 58 63 343 59 61 344 50 62 345 59 61 346 56 60 347

144 |
145 |
146 |
147 |
148 | 149 | 150 | 151 | 1.068511 0 0 0 0 1.068512 0 0 0 0 1.068512 0 0 0 0 1 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 |
-------------------------------------------------------------------------------- /tuna_gazebo/meshes/prop_right.dae: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Blender User 6 | Blender 2.90.1 commit date:2020-09-23, commit time:06:43, hash:3e85bb34d0d7 7 | 8 | 2022-09-22T01:34:45 9 | 2022-09-22T01:34:45 10 | 11 | Z_UP 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 0 0 0 1 20 | 21 | 22 | 0.8 0.8 0.8 1 23 | 24 | 25 | 1.45 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 0 0 0 1 37 | 38 | 39 | 0 0 0 1 40 | 41 | 42 | 1.45 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 0 0 0 1 54 | 55 | 56 | 0 0.01575971 0.2140349 1 57 | 58 | 59 | 1.45 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 1 0.8450995 0 1 71 | 72 | 73 | 0.8000001 0.5478113 0 1 74 | 75 | 76 | 1.45 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | -18.84557 -8.266201 -7.539108 -16.82127 -1.016515 0.4821085 -17.26124 0.2838485 -0.8751246 -19.09933 -6.865723 -9.015815 -16.78647 -6.91671 -9.04018 -15.09333 -0.9652844 0.2343032 -16.06734 0.5871385 -0.726529 -17.65687 -5.331914 -10.07062 -14.82225 -4.003664 -10.65852 -13.89751 -0.9074974 -0.0659182 -14.97687 0.7286443 -0.5352949 -15.514 -2.266613 -11.15546 -12.79792 -0.7075238 -11.37698 -12.71125 -0.8634191 -0.345284 -13.81698 0.8093211 -0.2904644 -13.74851 1.10506 -11.31521 -11.14513 4.424085 -10.4996 -11.05902 -0.62048 -0.6767717 -12.12597 0.9182153 0.1198554 -12.0661 6.078298 -9.617714 -8.755251 8.196836 -7.89828 -9.035195 -0.3255114 -0.9036175 -10.06966 0.7877788 0.4780619 -9.45266 9.399282 -6.42662 -18.84557 8.266209 7.539128 -16.82127 1.016524 -0.4820878 -17.26124 -0.2838391 0.8751456 -19.09933 6.865733 9.015836 -16.78647 6.916718 9.0402 -15.09333 0.9652932 -0.2342821 -16.06734 -0.5871292 0.7265778 -17.65687 5.331922 10.07064 -14.82225 4.003673 10.65854 -13.89751 0.9075065 0.06593906 -14.97687 -0.728635 0.5353161 -15.514 2.266622 11.15548 -12.79792 0.707535 11.37699 -12.71125 0.8634282 0.3453049 -13.81698 -0.8093122 0.2904855 -13.74851 -1.105049 11.31523 -11.14513 -4.424076 10.49962 -11.05902 0.620489 0.6767926 -12.12597 -0.918206 -0.1198344 -12.0661 -6.078288 9.617737 -8.755251 -8.196826 7.898304 -9.035195 0.3255205 0.9036383 -10.06966 -0.7877697 -0.4780408 -9.45266 -9.399274 6.426641 -22.12812 0.9454521 -0.6439705 -22.12958 0.279715 -1.1092 -22.12958 -0.6439568 -0.945446 -22.12958 -1.109191 -0.2797127 -22.12958 -0.9454361 0.6439667 -22.12812 -0.2796989 1.1092 -22.12572 0.6439747 0.945446 -22.12572 1.109208 0.2797089 0.196455 0.2750535 -1.112457 0.1979045 0.9407886 -0.6472283 0.196455 -1.113855 -0.2829704 0.196455 -0.6486222 -0.9487038 0.2003154 1.104544 0.2764511 0.2003154 0.6393112 0.9421883 0.1979045 -0.2843624 1.105942 0.196455 -0.9500996 0.6407089 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | -0.362262 -0.9162451 0.1710596 -0.3912863 -0.1476822 0.908342 -0.684401 0.7172706 0.1308373 -0.554627 0.174845 -0.8135221 -0.5422905 0.003082394 -0.8401855 -0.2153726 0.9369642 0.2751594 0.4929509 -0.7972913 -0.348319 -0.7846882 -0.236496 -0.5730046 -0.534518 0.352683 -0.768053 -0.1898625 0.8350778 0.5163308 0.2302337 -0.4375172 0.8692359 0.1550046 -0.2548619 0.9544733 0.5298771 -0.5744965 -0.6238462 0.5067312 0.07547253 -0.8587942 0.5985483 -0.3095898 -0.7388464 0.1943162 -0.7057888 0.6812513 -0.249797 0.5938668 0.7648031 0.1167354 0.9728564 0.1998083 -0.5862216 0.637281 -0.5002172 -0.2070384 0.2627655 0.942385 0.2085363 -0.9089472 0.3610092 0.7453665 -0.6416628 0.1808252 0.7386379 0.4582839 -0.4943582 0.3369558 0.01812803 0.941346 -0.362262 0.9162451 -0.1710596 -0.3912863 0.1476822 -0.908342 -0.684401 -0.7172706 -0.1308373 -0.554627 -0.174845 0.8135221 -0.5422905 -0.003082394 0.8401855 -0.2153745 -0.9369722 -0.2751312 0.4929509 0.7972913 0.348319 -0.7846882 0.236496 0.5730046 -0.534518 -0.352683 0.768053 -0.1898625 -0.8350778 -0.5163308 0.2302337 0.4375172 -0.8692359 0.1550046 0.2548619 -0.9544733 0.5298771 0.5744965 0.6238462 0.5067312 -0.07547253 0.8587942 0.5985483 0.3095898 0.7388464 0.1943162 0.7057888 -0.6812513 -0.249797 -0.5938668 -0.7648031 0.1167354 -0.9728564 -0.1998083 -0.5862216 -0.637281 0.5002172 -0.2070384 -0.2627655 -0.942385 0.2085363 0.9089472 -0.3610092 0.7453665 0.6416628 -0.1808252 0.7386379 -0.4582839 0.4943582 0.3369558 -0.01812803 -0.941346 0.6303489 0.6538794 -0.4184522 -0.6306152 0.6547558 -0.4166767 -0.6290653 0.7589863 0.1679786 0.629738 -0.6551302 0.4174143 0.6314409 0.4168609 0.653842 -0.6312385 -0.6534874 0.4177228 -0.6305928 -0.7579199 -0.1670634 -0.6288476 0.4189062 0.6550331 -0.6301629 -0.1664829 0.758405 0.6298933 -0.1684374 0.7581976 -0.6307948 0.1678844 -0.7575703 0.6316975 0.7571336 0.1664546 0.6292794 0.1670326 -0.7590174 -0.6303486 -0.4176891 -0.6543673 0.62995 -0.4180541 -0.6545181 0.6301719 -0.7582023 -0.1673703 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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19 18 43 18 19 44 18 19 45 14 16 46 13 15 47 19 18 48 15 8 49 14 16 50 17 20 51 13 15 52 12 14 53 21 21 54 17 20 55 16 13 56 20 22 57 16 13 58 19 18 59 22 23 60 18 19 61 17 20 62 24 24 63 25 25 64 26 26 65 35 27 66 31 28 67 30 29 68 28 30 69 24 24 70 27 31 71 30 29 72 26 26 73 25 25 74 31 28 75 27 31 76 26 26 77 25 25 78 24 24 79 28 30 80 39 32 81 35 27 82 34 33 83 33 34 84 29 35 85 28 30 86 32 36 87 28 30 88 31 28 89 34 33 90 30 29 91 29 35 92 40 37 93 36 38 94 39 32 95 37 39 96 33 34 97 32 36 98 36 38 99 32 36 100 35 27 101 38 40 102 34 33 103 33 34 104 47 41 105 43 42 106 42 43 107 42 43 108 38 40 109 37 39 110 43 42 111 39 32 112 38 40 113 41 44 114 37 39 115 36 38 116 45 45 117 41 44 118 40 37 119 44 46 120 40 37 121 43 42 122 46 47 123 42 43 124 41 44 125 45 45 126 44 46 127 47 41 128 21 21 129 20 22 130 23 17 131 0 0 162 2 2 163 3 7 164 11 3 165 6 5 166 10 9 167 4 6 168 3 7 169 7 4 170 6 5 171 1 1 172 5 11 173 7 4 174 2 2 175 6 5 176 1 1 177 4 6 178 5 11 179 15 8 180 10 9 181 14 16 182 9 10 183 4 6 184 8 12 185 8 12 186 7 4 187 11 3 188 10 9 189 5 11 190 9 10 191 16 13 192 15 8 193 19 18 194 13 15 195 8 12 196 12 14 197 12 14 198 11 3 199 15 8 200 14 16 201 9 10 202 13 15 203 23 17 204 18 19 205 22 23 206 18 19 207 13 15 208 17 20 209 19 18 210 14 16 211 18 19 212 17 20 213 12 14 214 16 13 215 21 21 216 16 13 217 20 22 218 20 22 219 19 18 220 23 17 221 22 23 222 17 20 223 21 21 224 24 24 225 26 26 226 27 31 227 35 27 228 30 29 229 34 33 230 28 30 231 27 31 232 31 28 233 30 29 234 25 25 235 29 35 236 31 28 237 26 26 238 30 29 239 25 25 240 28 30 241 29 35 242 39 32 243 34 33 244 38 40 245 33 34 246 28 30 247 32 36 248 32 36 249 31 28 250 35 27 251 34 33 252 29 35 253 33 34 254 40 37 255 39 32 256 43 42 257 37 39 258 32 36 259 36 38 260 36 38 261 35 27 262 39 32 263 38 40 264 33 34 265 37 39 266 47 41 267 42 43 268 46 47 269 42 43 270 37 39 271 41 44 272 43 42 273 38 40 274 42 43 275 41 44 276 36 38 277 40 37 278 45 45 279 40 37 280 44 46 281 44 46 282 43 42 283 47 41 284 46 47 285 41 44 286 45 45 287 45 45 288 47 41 289 46 47 290 21 21 291 23 17 292 22 23 293

138 |
139 | 140 | 141 | 142 | 143 |

57 48 132 48 49 133 55 50 134 63 51 135 57 48 136 61 52 137 63 51 138 52 53 139 51 54 140 54 55 141 53 56 142 62 57 143 49 58 144 53 56 145 55 50 146 53 56 147 52 53 148 63 51 149 61 52 150 60 59 151 55 50 152 56 60 153 49 58 154 48 49 155 51 54 156 50 61 157 59 62 158 50 61 159 49 58 160 56 60 161 57 48 294 55 50 295 60 59 296 59 62 297 63 51 298 58 63 299 63 51 300 61 52 301 62 57 302 61 52 303 57 48 304 60 59 305 57 48 306 59 62 307 56 60 308 59 62 309 57 48 310 63 51 311 63 51 312 51 54 313 58 63 314 54 55 315 62 57 316 61 52 317 51 54 318 49 58 319 50 61 320 49 58 321 55 50 322 48 49 323 55 50 324 53 56 325 54 55 326 53 56 327 51 54 328 52 53 329 51 54 330 53 56 331 49 58 332 53 56 333 63 51 334 62 57 335 61 52 336 55 50 337 54 55 338 56 60 339 48 49 340 57 48 341 51 54 342 59 62 343 58 63 344 50 61 345 56 60 346 59 62 347

144 |
145 |
146 |
147 |
148 | 149 | 150 | 151 | 1.068511 0 0 0 0 1.068512 0 0 0 0 1.068512 0 0 0 0 1 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 |
-------------------------------------------------------------------------------- /tuna_gazebo/meshes/stl/fin_left_1.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoffKalast/tuna/16065bacc6a904e335cc2f3c4ec2dc8696b63499/tuna_gazebo/meshes/stl/fin_left_1.stl -------------------------------------------------------------------------------- /tuna_gazebo/meshes/stl/fin_left_2.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoffKalast/tuna/16065bacc6a904e335cc2f3c4ec2dc8696b63499/tuna_gazebo/meshes/stl/fin_left_2.stl -------------------------------------------------------------------------------- /tuna_gazebo/meshes/stl/fin_right_1.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoffKalast/tuna/16065bacc6a904e335cc2f3c4ec2dc8696b63499/tuna_gazebo/meshes/stl/fin_right_1.stl -------------------------------------------------------------------------------- /tuna_gazebo/meshes/stl/fin_right_2.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoffKalast/tuna/16065bacc6a904e335cc2f3c4ec2dc8696b63499/tuna_gazebo/meshes/stl/fin_right_2.stl -------------------------------------------------------------------------------- /tuna_gazebo/meshes/stl/gnss_bottom.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoffKalast/tuna/16065bacc6a904e335cc2f3c4ec2dc8696b63499/tuna_gazebo/meshes/stl/gnss_bottom.stl -------------------------------------------------------------------------------- /tuna_gazebo/meshes/stl/gnss_top.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoffKalast/tuna/16065bacc6a904e335cc2f3c4ec2dc8696b63499/tuna_gazebo/meshes/stl/gnss_top.stl -------------------------------------------------------------------------------- /tuna_gazebo/meshes/stl/hook.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoffKalast/tuna/16065bacc6a904e335cc2f3c4ec2dc8696b63499/tuna_gazebo/meshes/stl/hook.stl -------------------------------------------------------------------------------- /tuna_gazebo/meshes/stl/stern_bottom.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoffKalast/tuna/16065bacc6a904e335cc2f3c4ec2dc8696b63499/tuna_gazebo/meshes/stl/stern_bottom.stl -------------------------------------------------------------------------------- /tuna_gazebo/meshes/stl/stern_top.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoffKalast/tuna/16065bacc6a904e335cc2f3c4ec2dc8696b63499/tuna_gazebo/meshes/stl/stern_top.stl -------------------------------------------------------------------------------- /tuna_gazebo/meshes/stl/tower.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoffKalast/tuna/16065bacc6a904e335cc2f3c4ec2dc8696b63499/tuna_gazebo/meshes/stl/tower.stl -------------------------------------------------------------------------------- /tuna_gazebo/package.xml: -------------------------------------------------------------------------------- 1 | 2 | tuna_gazebo 3 | 0.1.0 4 | Gazebo setup for Tuna. 5 | 6 | Vid Rijavec 7 | 8 | MIT 9 | 10 | catkin 11 | 12 | std_msgs 13 | 14 | message_generation 15 | message_runtime 16 | 17 | message_runtime 18 | rospy 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /tuna_gazebo/scripts/ign_interfacer.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import numpy as np 4 | import rospy 5 | import time 6 | import math 7 | import random 8 | import tf 9 | 10 | from std_msgs.msg import Header, String, Float64 11 | from sensor_msgs.msg import JointState 12 | from geometry_msgs.msg import Vector3, Twist 13 | 14 | MIN_SPD = 0.15 15 | MAX_SPD = 0.45 16 | 17 | DEADMAN = 0.6 # seconds 18 | 19 | def clamp(val, minval, maxval): 20 | if val < minval: 21 | return minval 22 | if val > maxval: 23 | return maxval 24 | return val 25 | 26 | # Stand in for the hardware drivers 27 | class IGNInterfacer: 28 | def __init__(self): 29 | rospy.init_node('ign_interfacer') 30 | 31 | self.right_pub = rospy.Publisher("prop_spd_right", Float64, queue_size=1) 32 | self.left_pub = rospy.Publisher("prop_spd_left", Float64, queue_size=1) 33 | 34 | self.diff_drive_sub = rospy.Subscriber("diff_drive", JointState, self.diff_drive_cb) 35 | 36 | self.m_sleep = True 37 | self.m_time = time.time() 38 | self.m_left_vel = 0 39 | self.m_right_vel = 0 40 | 41 | rospy.loginfo("Motors Ready") 42 | 43 | def diff_drive_cb(self, msg): 44 | self.m_time = time.time() 45 | self.m_sleep = False 46 | 47 | left_vel = msg.velocity[0] 48 | right_vel = msg.velocity[1] 49 | 50 | if left_vel == 0.0 and right_vel == 0.0: 51 | self.stop() 52 | return 53 | 54 | # just in case 55 | left_spd = clamp(abs(left_vel), MIN_SPD, MAX_SPD) 56 | right_spd = clamp(abs(right_vel), MIN_SPD, MAX_SPD) 57 | 58 | self.m_left_vel = math.copysign(left_spd, left_vel) * 2.0 59 | self.m_right_vel = math.copysign(right_spd, right_vel) * 2.0 60 | 61 | def update(self): 62 | if self.m_sleep: 63 | return 64 | 65 | if rospy.get_time() - self.m_time > DEADMAN: 66 | self.stop() 67 | self.m_sleep = True 68 | else: 69 | self.right_pub.publish(self.m_left_vel) 70 | self.left_pub.publish(self.m_right_vel) 71 | 72 | 73 | def stop(self): 74 | self.m_left_vel = 0.0 75 | self.m_right_vel = 0.0 76 | self.right_pub.publish(0.0) 77 | self.left_pub.publish(0.0) 78 | self.m_sleep = True 79 | 80 | try: 81 | ctrl = IGNInterfacer() 82 | rate = rospy.Rate(10) 83 | while not rospy.is_shutdown(): 84 | ctrl.update() 85 | rate.sleep() 86 | 87 | except Exception as e: 88 | print(e) -------------------------------------------------------------------------------- /tuna_gazebo/scripts/wave_generator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import numpy as np 4 | import rospy 5 | import time 6 | import math 7 | import random 8 | import tf 9 | 10 | from visualization_msgs.msg import Marker, MarkerArray 11 | from geometry_msgs.msg import Vector3 12 | from tf.transformations import quaternion_from_euler, euler_from_quaternion, quaternion_multiply, quaternion_conjugate, quaternion_inverse 13 | 14 | def clamp(num, min, max): 15 | return min if num < min else max if num > max else num 16 | 17 | 18 | class WindGen: 19 | def __init__(self): 20 | rospy.init_node('gazebo_wave_generator') 21 | 22 | self.wave_magnitude = 0.3 23 | self.wave_pub = rospy.Publisher("ocean_current", Vector3, queue_size=1) 24 | self.marker_pub = rospy.Publisher("wave_arrows", MarkerArray, queue_size=1) 25 | 26 | rospy.loginfo("Wave Generator started") 27 | 28 | self.vel = Vector3() 29 | self.vel.x = 0.0 30 | self.vel.y = 0.0 31 | 32 | self.dir_x = 0.0 33 | self.dir_y = 0.0 34 | 35 | def update(self): 36 | 37 | self.dir_x = self.dir_x * 0.97 + (random.random()*0.1 - 0.05) * 0.03 38 | self.dir_y = self.dir_y * 0.97 + (random.random()*0.1 - 0.05) * 0.03 39 | 40 | self.vel.x = clamp(self.vel.x + self.dir_x, -0.35, 0.35) 41 | self.vel.y = clamp(self.vel.y - self.dir_x, -0.35, 0.35) 42 | self.wave_pub.publish(self.vel) 43 | 44 | rotation = quaternion_from_euler(0,0,math.atan2(self.vel.y, self.vel.x)) 45 | 46 | markerArray = MarkerArray() 47 | 48 | marker_id = 0; 49 | for i in range(-2,12,2): 50 | for j in range(-2,12,2): 51 | arrow = Marker() 52 | arrow.header.frame_id = "map" 53 | arrow.type = arrow.ARROW 54 | arrow.pose.position.x = i 55 | arrow.pose.position.y = j 56 | arrow.pose.position.z = 0.0 57 | 58 | arrow.pose.orientation.x = rotation[0] 59 | arrow.pose.orientation.y = rotation[1] 60 | arrow.pose.orientation.z = rotation[2] 61 | arrow.pose.orientation.w = rotation[3] 62 | 63 | arrow.scale.x = math.sqrt(self.vel.x*self.vel.x + self.vel.y*self.vel.y)*1.5 64 | arrow.scale.y = arrow.scale.x*0.25 65 | arrow.scale.z = arrow.scale.x*0.25 66 | 67 | arrow.color.a = 0.2 68 | 69 | arrow.color.r = 0.4 70 | arrow.color.g = 0.4 71 | arrow.color.b = 1.0 72 | 73 | arrow.id = marker_id 74 | markerArray.markers.append(arrow) 75 | 76 | marker_id +=1 77 | 78 | self.marker_pub.publish(markerArray) 79 | 80 | try: 81 | wave = WindGen() 82 | rate = rospy.Rate(15) 83 | while not rospy.is_shutdown(): 84 | wave.update() 85 | rate.sleep() 86 | 87 | wave.vel.x = 0 88 | wave.vel.y = 0 89 | wave.wave_pub.publish(wave.vel) 90 | wave.marker_pub.publish(MarkerArray()) 91 | 92 | except Exception as e: 93 | print(e) -------------------------------------------------------------------------------- /tuna_gazebo/water_world.sdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0.001 5 | 1 6 | 1000 7 | 8 | 9 | 10 | 11 | EARTH_WGS84 12 | ENU 13 | 46.06661, 14 | 14.46993 15 | 0 16 | 0 17 | 18 | 19 | 20 | 21 | 1000 22 | 23 | 0 24 | 1 25 | 26 | 27 | tuna::boat 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 3D View 38 | false 39 | docked 40 | 41 | false 42 | ogre2 43 | scene 44 | 0.4 0.4 0.4 45 | 0.8 0.8 0.8 46 | 0 -6 8 0 0.8 1.56 47 | 48 | 49 | 50 | 51 | floating 52 | 5 53 | 5 54 | false 55 | 56 | 57 | 58 | 59 | 60 | false 61 | 5 62 | 5 63 | floating 64 | false 65 | 66 | 67 | 68 | 69 | 70 | false 71 | 5 72 | 5 73 | floating 74 | false 75 | 76 | 77 | 78 | 79 | 80 | false 81 | 5 82 | 5 83 | floating 84 | false 85 | 86 | 87 | 88 | 89 | 90 | false 91 | 5 92 | 5 93 | floating 94 | false 95 | 96 | 97 | 98 | 99 | 100 | false 101 | 5 102 | 5 103 | floating 104 | false 105 | 106 | 107 | 108 | 109 | 110 | World control 111 | false 112 | false 113 | 72 114 | 121 115 | 1 116 | floating 117 | 118 | 119 | 120 | 121 | 122 | true 123 | true 124 | true 125 | true 126 | 127 | 128 | 129 | 130 | World stats 131 | false 132 | false 133 | 110 134 | 290 135 | 1 136 | floating 137 | 138 | 139 | 140 | 141 | 142 | true 143 | true 144 | true 145 | true 146 | 147 | 148 | 149 | 150 | false 151 | 250 152 | 50 153 | floating 154 | false 155 | #777777 156 | 157 | false 158 | 159 | 160 | 161 | 162 | docked 163 | 164 | 165 | 166 | 167 | 168 | GNSS 169 | docked 170 | 171 | /gnss/fix 172 | true 173 | 174 | 175 | 176 | 177 | Grid Config 178 | false 179 | 180 | 181 | 60 182 | 0 183 | 5.0 184 | -90 75 0 0 0 0 185 | 1 1 1 0.7 186 | 187 | false 188 | 189 | 190 | 191 | 192 | 0 0 -9.81 193 | 6e-06 2.3e-05 -4.2e-05 194 | 195 | 196 | 0.4 0.4 0.4 1 197 | 0.7 0.7 0.7 1 198 | 199 | true 200 | 201 | 202 | 203 | -91.7405 76.9637 0 0 0 0 204 | true 205 | 206 | 207 | 0 0 0 0 -0 0 208 | 209 | 210 | 300 300 211 | 0 0 1 212 | 213 | 214 | 215 | 0.4 0.72 0.85 0.3 216 | 0.4 0.72 0.85 0.3 217 | 1 1 1 0.3 218 | 219 | 220 | 221 | 0 0 0 0 -0 0 222 | 223 | 224 | 300 300 225 | 0 0 -1 226 | 227 | 228 | 229 | 0.1, 0.32, 0.45 0.9 230 | 0.1, 0.32, 0.45 0.9 231 | 1 1 1 0.9 232 | 233 | 234 | 235 | 0 0 0 0 -0 0 236 | 1 237 | 238 | 1 239 | 0 240 | 0 241 | 1 242 | 0 243 | 1 244 | 245 | 246 | false 247 | 248 | 0 0 0 0 -0 0 249 | false 250 | 251 | 252 | 253 | 0 0 0 0 0 0 254 | 255 | -91.7405 76.9637 0 0 0 0 256 | 257 | 258 | 1.1 259 | -0.03 0 -0.02 0 0 0 260 | 261 | 1 262 | 0 263 | 0 264 | 1 265 | 0 266 | 1 267 | 268 | 269 | 270 | 271 | 272 | 273 | file://meshes/map.dae 274 | 275 | 276 | 277 | 278 | 279 | 0.000 0.000 -10.012 0 0 0 280 | 281 | 0.387 0.103 0.033 282 | 283 | 284 | 0.10.1 285 | 286 | 287 | 288 | 289 | 290 | true 291 | false 292 | 293 | 294 | 295 | 0 0 0 0 0 0 296 | 297 | 0 0 0 0 0 0 298 | 299 | 300 | 1.4 301 | -0.02 0 -0.02 0 0 0 302 | 303 | 0.00002 304 | 0 305 | 0 306 | 0.00002 307 | 0 308 | 0.00002 309 | 310 | 311 | 312 | 313 | 314 | file://meshes/boat.dae 315 | 316 | 317 | 318 | 319 | 320 | 321 | 0.000 0.000 0.012 0 0 0 322 | 323 | 0.387 0.103 0.033 324 | 325 | 326 | 0.10.1 327 | 328 | 329 | 330 | -0.007 0.000 0.037 0 0 0 331 | 332 | 0.185 0.078 0.017 333 | 334 | 335 | 0.10.1 336 | 337 | 338 | 339 | 0.012 0.000 0.053 0 0 0 340 | 341 | 0.108 0.056 0.017 342 | 343 | 344 | 0.10.1 345 | 346 | 347 | 348 | 0.021 0.000 0.095 0 0 0 349 | 350 | 0.045 0.044 0.070 351 | 352 | 353 | 0.10.1 354 | 355 | 356 | 357 | -0.082 -0.065 -0.020 0.64 0 0 358 | 359 | 0.112 0.043 0.009 360 | 361 | 362 | 0.10.1 363 | 364 | 365 | 366 | -0.224 0.000 0.012 0 0 0 367 | 368 | 0.062 0.064 0.033 369 | 370 | 371 | 0.10.1 372 | 373 | 374 | 375 | 0.22 0.000 0.012 0 0 0 376 | 377 | 0.07 0.061 0.033 378 | 379 | 380 | 0.10.1 381 | 382 | 383 | 384 | -0.028 0.000 -0.017 0 0 0 385 | 386 | 0.284 0.097 0.025 387 | 388 | 389 | 0.10.1 390 | 391 | 392 | 393 | 0.142 0.000 -0.017 0 0 0 394 | 395 | 0.056 0.083 0.025 396 | 397 | 398 | 0.10.1 399 | 400 | 401 | 402 | 0.188 0.000 -0.013 0 0 0 403 | 404 | 0.048 0.036 0.018 405 | 406 | 407 | 0.10.1 408 | 409 | 410 | 411 | -0.207 0.000 -0.016 0 0 0 412 | 413 | 0.074 0.066 0.023 414 | 415 | 416 | 0.10.1 417 | 418 | 419 | 420 | -0.082 0.065 -0.020 -0.64 0 0 421 | 422 | 0.112 0.043 0.009 423 | 424 | 425 | 0.10.1 426 | 427 | 428 | 429 | 430 | 1 431 | 25 432 | true 433 | imu 434 | imu 435 | 436 | 437 | 438 | true 439 | 5 440 | gnss/fix 441 | 442 | 443 | 444 | 445 | 0.00001 446 | 0.0000002 447 | 448 | 449 | 450 | 451 | 0 452 | 0.000001 453 | 454 | 455 | 456 | 457 | gps 458 | 459 | 460 | 461 | 462 | 463 | 488 | 489 | 490 | 514 | 515 | 516 | base_link 517 | -0.00001 518 | -0.00001 519 | -0.00001 520 | 521 | -0.00001 522 | -0.00001 523 | -0.00001 524 | 525 | -4.5 526 | -0.001 527 | -6.5 528 | -0.001 529 | -30.0 530 | 0 531 | 532 | -0.01 533 | 0 534 | -2.4 535 | 0 536 | -0.13 537 | 0 538 | 539 | 0 0 0 540 | 541 | 542 | 543 | 544 | -0.14 -0.018 -0.043 0 -0.05 0 545 | 546 | 0.01 547 | 548 | 0.019 549 | 0 550 | 0 551 | 0.019 552 | 0 553 | 0.019 554 | 555 | 556 | 557 | 558 | file://meshes/prop_left.dae 559 | 560 | 561 | 562 | 563 | 564 | -0.14 0.018 -0.043 0 -0.05 0 565 | 566 | 0.01 567 | 568 | 0.019 569 | 0 570 | 0 571 | 0.019 572 | 0 573 | 0.019 574 | 575 | 576 | 577 | 578 | file://meshes/prop_right.dae 579 | 580 | 581 | 582 | 583 | 584 | base_link 585 | prop_right 586 | 587 | 1 0 0 588 | 589 | -1000000000000 590 | 1000000000000 591 | inf 592 | inf 593 | 100000000 594 | 1 595 | 596 | 597 | 0 598 | 0 599 | 0 600 | 0 601 | 602 | 603 | 604 | 605 | 606 | base_link 607 | prop_left 608 | 609 | 1 0 0 610 | 611 | -1000000000000 612 | 1000000000000 613 | inf 614 | inf 615 | 100000000 616 | 1 617 | 618 | 619 | 0 620 | 0 621 | 0 622 | 0 623 | 624 | 625 | 626 | 627 | 628 | base_to_prop_left 629 | 1000 630 | 0.025 631 | 0.0 632 | 633 | 634 | 635 | base_to_prop_right 636 | 1000 637 | 0.025 638 | 0.0 639 | 640 | 641 | 642 | battery 643 | 12.5 644 | 4.2 645 | -2.0 646 | 2.1 647 | 2.2 648 | 0.04 649 | 2.0 650 | true 651 | 3.0 652 | 0.51 653 | 1.2 654 | true 655 | 656 | 657 | 658 | false 659 | false 660 | 661 | 662 | 663 | 0 0 10 0 -0 0 664 | true 665 | 1 666 | -0.5 0.1 -0.9 667 | 1 1 1 1 668 | 0.5 0.5 0.5 1 669 | 670 | 1000 671 | 0.01 672 | 0.90000000000000002 673 | 0.001 674 | 675 | 676 | 0 677 | 0 678 | 0 679 | 680 | 681 | 682 | 683 | -------------------------------------------------------------------------------- /tuna_motor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(tuna_motor) 3 | 4 | find_package(catkin REQUIRED COMPONENTS 5 | roscpp 6 | rospy 7 | sensor_msgs 8 | message_generation 9 | std_msgs 10 | ) 11 | 12 | catkin_python_setup() 13 | 14 | generate_messages(DEPENDENCIES std_msgs) 15 | 16 | catkin_package( 17 | CATKIN_DEPENDS std_msgs sensor_msgs message_runtime 18 | ) 19 | -------------------------------------------------------------------------------- /tuna_motor/launch/electronics.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tuna_motor/nodes/battery.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import rospy 4 | import smbus 5 | import time 6 | 7 | from sensor_msgs.msg import BatteryState 8 | 9 | #http://www.smartypies.com/projects/ads1115-with-raspberrypi-and-python/ads1115runner/ 10 | 11 | #http://www.ti.com/lit/ds/symlink/ads1115.pdf page 28 12 | 13 | #000 : FSR = 6.144 V 14 | #001 : FSR = 4.096 V 15 | #010 : FSR = 2.048 V (default) 16 | #011 : FSR = 1.024 V 17 | #100 : FSR = 0.512 V 18 | #101 : FSR = 0.256 V 19 | #110 : FSR = 0.256 V 20 | #111 : FSR = 0.256 V 21 | 22 | #000 : AINP = AIN0 and AINN = AIN1 (default) 23 | #001 : AINP = AIN0 and AINN = AIN3 24 | #010 : AINP = AIN1 and AINN = AIN3 25 | #011 : AINP = AIN2 and AINN = AIN3 26 | #100 : AINP = AIN0 and AINN = GND 27 | #101 : AINP = AIN1 and AINN = GND 28 | #110 : AINP = AIN2 and AINN = GND 29 | #111 : AINP = AIN3 and AINN = GND 30 | 31 | LIPO= [ 32 | 3.27, # 0 33 | 3.61, # 5 34 | 3.69, # 10 35 | 3.71, # 15 36 | 3.73, # 20 37 | 3.75, # 25 38 | 3.77, # 30 39 | 3.79, # 35 40 | 3.80, # 40 41 | 3.82, # 45 42 | 3.84, # 50 43 | 3.85, # 55 44 | 3.87, # 60 45 | 3.91, # 65 46 | 3.95, # 70 47 | 3.98, # 75 48 | 4.02, # 80 49 | 4.08, # 85 50 | 4.11, # 90 51 | 4.15, # 95 52 | 4.20, # 100 53 | ] 54 | 55 | LION= [ 56 | 3.3, # 0 57 | 3.35, 58 | 3.49, 59 | 3.50, 60 | 3.53, 61 | 3.54, 62 | 3.55, 63 | 3.58, 64 | 3.60, 65 | 3.62, 66 | 3.64, 67 | 3.67, 68 | 3.70, 69 | 3.75, 70 | 3.80, 71 | 3.88, 72 | 3.85, 73 | 3.95, 74 | 4.05, 75 | 4.10, 76 | 4.20, # 100 77 | ] 78 | 79 | ADDRESS = 0x48 80 | POINTER_CFG = 0x1 81 | POINTER_CONV = 0x0 82 | 83 | def swap2Bytes(c): 84 | '''Revert Byte order for Words (2 Bytes, 16 Bit).''' 85 | return (c>>8 |c<<8)&0xFFFF 86 | 87 | def prepareLEconf(BEconf): 88 | '''Prepare LittleEndian Byte pattern from BigEndian configuration string, with separators.''' 89 | c = int(BEconf.replace('-',''), base=2) 90 | return swap2Bytes(c) 91 | 92 | def LEtoBE(c): 93 | '''Little Endian to BigEndian conversion for signed 2Byte integers (2 complement).''' 94 | c = swap2Bytes(c) 95 | if(c >= 2**15): 96 | c= c-2**16 97 | return c 98 | 99 | class Battery: 100 | def __init__(self): 101 | rospy.init_node('battery') 102 | self.pub = rospy.Publisher('/battery_state', BatteryState, queue_size=1) 103 | self.bus = smbus.SMBus(1) 104 | 105 | def clamp(self, val, minval, maxval): 106 | return max(min(val, maxval), minval) 107 | 108 | def capacity(self, voltage, cells, type): 109 | onecell = voltage / cells 110 | 111 | if onecell >= type[20]: 112 | return 1.0 113 | elif onecell <= type[0]: 114 | return 0.0 115 | 116 | upper = 0 117 | lower = 0 118 | 119 | for i in range(0,len(type)): 120 | if onecell > type[i]: 121 | lower = i 122 | else: 123 | upper = i 124 | break 125 | 126 | deltavoltage = type[upper] - type[lower] 127 | between_percent = (onecell - type[lower]) / deltavoltage 128 | 129 | upper = float(upper) * 5.0 130 | lower = float(lower) * 5.0 131 | 132 | return (lower + (upper-lower) * between_percent) / 100 133 | 134 | def read(self): 135 | try: 136 | # start single conversion - AIN0/GND - 4.096V - single shot - 8SPS - X - X - X - disable comparator 137 | 138 | conf = prepareLEconf('1-100-001-1-000-0-0-0-11') 139 | 140 | self.bus.write_word_data(ADDRESS, POINTER_CFG, conf) 141 | 142 | rospy.sleep(0.2) 143 | 144 | value_raw = self.bus.read_word_data(ADDRESS, POINTER_CONV) 145 | value = LEtoBE(value_raw) 146 | value = value * 0.0004504553 + 1.58421 147 | 148 | battery_msg = BatteryState() 149 | battery_msg.voltage = value 150 | 151 | battery_msg.current = float('nan') 152 | battery_msg.current = float('nan') 153 | 154 | battery_msg.percentage = self.clamp(self.capacity(value, 3, LIPO) + 0.03, 0.0, 1.0) 155 | battery_msg.charge = 5.0 * battery_msg.percentage 156 | battery_msg.capacity = 5.0 157 | battery_msg.design_capacity = 5.0 158 | battery_msg.present = True 159 | battery_msg.cell_voltage = [value/3.0, value/3.0, value/3.0] 160 | 161 | battery_msg.power_supply_status = BatteryState.POWER_SUPPLY_STATUS_DISCHARGING 162 | battery_msg.power_supply_health = BatteryState.POWER_SUPPLY_HEALTH_UNKNOWN 163 | battery_msg.power_supply_technology = BatteryState.POWER_SUPPLY_TECHNOLOGY_LIPO 164 | 165 | self.pub.publish(battery_msg) 166 | 167 | except: 168 | pass 169 | try: 170 | 171 | b = Battery() 172 | rate = rospy.Rate(1) 173 | while not rospy.is_shutdown(): 174 | b.read() 175 | rate.sleep() 176 | 177 | except rospy.ROSInterruptException: 178 | print("Script interrupted", file=sys.stderr) 179 | -------------------------------------------------------------------------------- /tuna_motor/nodes/motor.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import rospy 4 | import time 5 | import pigpio 6 | import math 7 | import sys 8 | 9 | from std_msgs.msg import Header, String 10 | from sensor_msgs.msg import JointState 11 | 12 | PIN_STBY = 17 13 | PIN_A1 = 27 14 | PIN_A2 = 22 15 | 16 | PIN_B1 = 24 17 | PIN_B2 = 23 18 | 19 | PIN_PWM1 = 12 20 | PIN_PWM2 = 13 21 | 22 | MIN_SPD = 15 23 | MAX_SPD = 45 24 | 25 | DEADMAN = 0.6 # seconds 26 | 27 | def clamp(val, minval, maxval): 28 | if val < minval: 29 | return minval 30 | if val > maxval: 31 | return maxval 32 | return val 33 | 34 | class Motor: 35 | 36 | def __init__(self, pi, PIN_DIR1, PIN_DIR2, PIN_PWM): 37 | self.pi = pi 38 | 39 | self.PIN_DIR1 = PIN_DIR1 40 | self.PIN_DIR2 = PIN_DIR2 41 | self.PIN_PWM = PIN_PWM 42 | 43 | self.pi.set_mode(self.PIN_DIR1, pigpio.OUTPUT) 44 | self.pi.write(self.PIN_DIR1, 0) 45 | 46 | self.pi.set_mode(self.PIN_DIR2, pigpio.OUTPUT) 47 | self.pi.write(self.PIN_DIR2, 0) 48 | 49 | self.pi.set_mode(self.PIN_PWM, pigpio.OUTPUT) 50 | self.pi.set_PWM_range(self.PIN_PWM, 100) 51 | self.pi.set_PWM_frequency(self.PIN_PWM, 20000) 52 | self.pi.set_PWM_dutycycle(self.PIN_PWM, 0) 53 | 54 | def set(self, velocity): 55 | 56 | if velocity > 0: 57 | self.pi.write(self.PIN_DIR1, 1) 58 | self.pi.write(self.PIN_DIR2, 0) 59 | else: 60 | self.pi.write(self.PIN_DIR1, 0) 61 | self.pi.write(self.PIN_DIR2, 1) 62 | 63 | self.pi.set_PWM_dutycycle(self.PIN_PWM, clamp(abs(velocity), 0, MAX_SPD)) 64 | 65 | def stop(self): 66 | self.pi.write(self.PIN_DIR1, 0) 67 | self.pi.write(self.PIN_DIR2, 0) 68 | self.pi.set_PWM_dutycycle(self.PIN_PWM, 0) 69 | 70 | class Controller: 71 | def __init__(self): 72 | rospy.init_node('motortest') 73 | 74 | self.pi = pigpio.pi() 75 | 76 | # standby switch 77 | self.pi.set_mode(PIN_STBY, pigpio.OUTPUT) 78 | self.pi.write(PIN_STBY, 0) 79 | 80 | #motor setup 81 | self.motor_right = Motor(self.pi, PIN_A1, PIN_A2, PIN_PWM1) 82 | self.motor_left = Motor(self.pi, PIN_B1, PIN_B2, PIN_PWM2) 83 | 84 | self.cmdsub = rospy.Subscriber("diff_drive", JointState, self.velocity) 85 | 86 | self.m_sleep = True 87 | self.m_time = time.time() 88 | self.m_left_vel = 0 89 | self.m_right_vel = 0 90 | 91 | rospy.loginfo("Motors Ready") 92 | 93 | def velocity(self, msg): 94 | 95 | self.m_time = time.time() 96 | self.m_sleep = False 97 | 98 | left_vel = int(msg.velocity[0] * 100) 99 | right_vel = int(msg.velocity[1] * 100) 100 | 101 | if left_vel == 0 and right_vel == 0: 102 | self.stop() 103 | return 104 | 105 | self.pi.write(PIN_STBY, 1) 106 | 107 | # just in case 108 | left_spd = clamp(abs(left_vel), MIN_SPD, MAX_SPD) 109 | right_spd = clamp(abs(right_vel), MIN_SPD, MAX_SPD) 110 | 111 | self.m_left_vel = math.copysign(left_spd, left_vel) 112 | self.m_right_vel = math.copysign(right_spd, right_vel) 113 | 114 | def update(self): 115 | if self.m_sleep: 116 | return 117 | 118 | if rospy.get_time() - self.m_time > DEADMAN: 119 | self.stop() 120 | self.m_sleep = True 121 | else: 122 | self.motor_left.set(self.m_left_vel) 123 | self.motor_right.set(self.m_right_vel) 124 | print(self.m_right_vel, self.m_left_vel) 125 | 126 | 127 | def stop(self): 128 | self.pi.write(PIN_STBY, 0) 129 | self.motor_left.stop() 130 | self.motor_right.stop() 131 | 132 | 133 | def cleanup(self): 134 | self.stop() 135 | self.pi.stop() 136 | 137 | 138 | try: 139 | ctrl = Controller() 140 | rospy.on_shutdown(ctrl.cleanup) 141 | rate = rospy.Rate(10) 142 | while not rospy.is_shutdown(): 143 | ctrl.update() 144 | rate.sleep() 145 | 146 | except Exception as e: 147 | print(e) 148 | -------------------------------------------------------------------------------- /tuna_motor/nodes/shutdown.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import rospy 4 | import os 5 | from sensor_msgs.msg import BatteryState 6 | 7 | class Shutdown: 8 | def __init__(self): 9 | rospy.init_node('shutdown') 10 | self.batt = rospy.Subscriber("/battery_state", BatteryState, self.battery) 11 | 12 | self.running = False 13 | self.warning = False 14 | self.shutdown = False 15 | self.percentage = 1.0 16 | 17 | def battery(self, msg): 18 | if msg.percentage < 0.1: 19 | return 20 | 21 | self.percentage = self.percentage * 0.9 + msg.percentage * 0.1 22 | if self.percentage < 0.2: 23 | os.system('sudo poweroff') 24 | 25 | try: 26 | s = Shutdown() 27 | rospy.spin() 28 | except Exception as e: 29 | print(e) 30 | -------------------------------------------------------------------------------- /tuna_motor/package.xml: -------------------------------------------------------------------------------- 1 | 2 | tuna_motor 3 | 0.1.0 4 | Karl motor control node. 5 | 6 | Vid Rijavec 7 | 8 | Vid Rijavec 9 | 10 | MIT 11 | 12 | catkin 13 | 14 | std_msgs 15 | sensor_msgs 16 | 17 | message_generation 18 | message_runtime 19 | 20 | message_runtime 21 | rospy 22 | 23 | 24 | -------------------------------------------------------------------------------- /tuna_motor/setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup 2 | from catkin_pkg.python_setup import generate_distutils_setup 3 | 4 | # fetch values from package.xml 5 | setup_args = generate_distutils_setup( 6 | packages=['tuna_motor'], 7 | package_dir={'': 'nodes'}, 8 | requires=['std_msgs', 'rospy'] 9 | ) 10 | 11 | setup(**setup_args) 12 | -------------------------------------------------------------------------------- /tuna_nav/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(tuna_nav) 3 | 4 | find_package(catkin REQUIRED COMPONENTS 5 | roscpp 6 | rospy 7 | message_generation 8 | std_msgs 9 | ) 10 | 11 | catkin_python_setup() 12 | 13 | generate_messages(DEPENDENCIES std_msgs) 14 | 15 | catkin_package( 16 | CATKIN_DEPENDS std_msgs message_runtime 17 | ) 18 | -------------------------------------------------------------------------------- /tuna_nav/launch/line_planner.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /tuna_nav/launch/localization.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tuna_nav/nodes/imu_filter.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import numpy as np 4 | import rospy 5 | import math 6 | import tf 7 | 8 | from geometry_msgs.msg import PoseWithCovarianceStamped 9 | from sensor_msgs.msg import Imu, MagneticField 10 | 11 | class IMUFilter: 12 | def __init__(self): 13 | rospy.init_node('imu_filter', anonymous=True) 14 | 15 | #self.mag_angle = 0 16 | #self.mag_angle_x = 0 17 | #self.mag_angle_y = 0 18 | #self.mag_angle_z = 0 19 | self.gyro_callib_y = None 20 | 21 | self.rotation = (0.0, 0.0, 0.0, 1.0) 22 | self.gps_rotation = None 23 | 24 | self.imu_pub = rospy.Publisher("imu/data", Imu, queue_size=50) 25 | 26 | self.imu_sub = rospy.Subscriber("imu/raw", Imu, self.imu_data) 27 | #self.mag_sub = rospy.Subscriber("imu/mag", MagneticField, self.mag_data) 28 | self.gps_sub = rospy.Subscriber("navsat_simple/heading", PoseWithCovarianceStamped, self.gps_data) 29 | 30 | self.pose_pub = rospy.Publisher('imu/debug_pose', PoseWithCovarianceStamped, queue_size=10) 31 | 32 | def gps_data(self, msg): 33 | q = msg.pose.pose.orientation 34 | 35 | if q.x == 0 and q.y == 0 and q.z == 0 and q.w == 0: 36 | self.gps_rotation = None 37 | else: 38 | self.gps_rotation = [q.x, q.y, q.z, q.w] 39 | 40 | #def mag_data(self, msg): 41 | #m = msg.magnetic_field 42 | #self.mag_angle = math.atan2(m.x, m.z) 43 | 44 | def imu_data(self, msg): 45 | self.imu_msg = msg 46 | 47 | if self.gyro_callib_y is None: 48 | self.gyro_callib_y = -msg.angular_velocity.y 49 | 50 | y = -msg.angular_velocity.y - self.gyro_callib_y 51 | deltarot = tf.transformations.quaternion_from_euler(0, 0, y * 0.0255) 52 | self.rotation = tf.transformations.quaternion_multiply(self.rotation, deltarot) 53 | 54 | #magquat = tf.transformations.quaternion_from_euler(self.mag_angle_x, self.mag_angle_y, self.mag_angle_z) 55 | #magquat = tf.transformations.quaternion_from_euler(0, 0, self.mag_angle) 56 | #self.rotation = tf.transformations.quaternion_slerp(self.rotation, magquat, 0.004) 57 | 58 | if not self.gps_rotation is None: 59 | self.rotation = tf.transformations.quaternion_slerp(self.rotation, self.gps_rotation, 0.03) 60 | 61 | msg.orientation.x = self.rotation[0] 62 | msg.orientation.y = self.rotation[1] 63 | msg.orientation.z = self.rotation[2] 64 | msg.orientation.w = self.rotation[3] 65 | self.imu_pub.publish(msg) 66 | 67 | try: 68 | b = IMUFilter() 69 | rospy.spin() 70 | except rospy.ROSInterruptException: 71 | print("Script interrupted", file=sys.stderr) 72 | -------------------------------------------------------------------------------- /tuna_nav/nodes/light_indicator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import rospy 4 | import time 5 | from std_msgs.msg import Bool 6 | 7 | class LightIndicator: 8 | def __init__(self): 9 | rospy.init_node('nav_indicator_light') 10 | self.light_state = False 11 | self.light_pub = rospy.Publisher("safety_light", Bool, queue_size=1) 12 | self.route_sub = rospy.Subscriber("line_planner/active", Bool, self.nav_callback) 13 | 14 | def nav_callback(self, msg): 15 | if msg.data != self.light_state: 16 | self.light_state = msg.data 17 | self.light_pub.publish(msg.data) 18 | 19 | 20 | try: 21 | l = LightIndicator() 22 | rospy.spin() 23 | except rospy.ROSInterruptException: 24 | print("Script interrupted", file=sys.stderr) 25 | -------------------------------------------------------------------------------- /tuna_nav/package.xml: -------------------------------------------------------------------------------- 1 | 2 | tuna_nav 3 | 0.1.0 4 | Teb local planner config for Karl. 5 | 6 | Vid Rijavec 7 | 8 | MIT 9 | 10 | catkin 11 | 12 | std_msgs 13 | 14 | message_generation 15 | message_runtime 16 | 17 | message_runtime 18 | rospy 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /tuna_nav/setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup 2 | from catkin_pkg.python_setup import generate_distutils_setup 3 | 4 | # fetch values from package.xml 5 | setup_args = generate_distutils_setup( 6 | packages=['tuna_nav'], 7 | package_dir={'': 'nodes'}, 8 | requires=['std_msgs', 'rospy'] 9 | ) 10 | 11 | setup(**setup_args) 12 | -------------------------------------------------------------------------------- /tuna_viz/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(tuna_viz) 3 | 4 | find_package(catkin REQUIRED COMPONENTS 5 | roscpp 6 | rospy 7 | message_generation 8 | std_msgs 9 | ) 10 | 11 | generate_messages(DEPENDENCIES std_msgs) 12 | 13 | catkin_package( 14 | CATKIN_DEPENDS std_msgs message_runtime 15 | ) 16 | -------------------------------------------------------------------------------- /tuna_viz/launch/rviz.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tuna_viz/package.xml: -------------------------------------------------------------------------------- 1 | 2 | tuna_viz 3 | 0.1.0 4 | Visual display for Tuna. 5 | 6 | Vid Rijavec 7 | 8 | MIT 9 | 10 | catkin 11 | 12 | std_msgs 13 | 14 | message_generation 15 | message_runtime 16 | 17 | message_runtime 18 | rospy 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /tuna_viz/rviz/config.rviz: -------------------------------------------------------------------------------- 1 | Panels: 2 | - Class: rviz/Displays 3 | Help Height: 87 4 | Name: Displays 5 | Property Tree Widget: 6 | Expanded: 7 | - /Global Options1 8 | Splitter Ratio: 0.5 9 | Tree Height: 623 10 | - Class: rviz/Selection 11 | Name: Selection 12 | - Class: rviz/Tool Properties 13 | Expanded: 14 | - /2D Pose Estimate1 15 | - /2D Nav Goal1 16 | - /Publish Point1 17 | Name: Tool Properties 18 | Splitter Ratio: 0.5886790156364441 19 | - Class: rviz/Views 20 | Expanded: 21 | - /Current View1 22 | Name: Views 23 | Splitter Ratio: 0.5 24 | - Class: rviz/Time 25 | Experimental: false 26 | Name: Time 27 | SyncMode: 0 28 | SyncSource: "" 29 | Preferences: 30 | PromptSaveOnExit: true 31 | Toolbars: 32 | toolButtonStyle: 2 33 | Visualization Manager: 34 | Class: "" 35 | Displays: 36 | - Alpha: 0.30000001192092896 37 | Cell Size: 1 38 | Class: rviz/Grid 39 | Color: 99; 99; 102 40 | Enabled: true 41 | Line Style: 42 | Line Width: 0.029999999329447746 43 | Value: Lines 44 | Name: Grid 45 | Normal Cell Count: 0 46 | Offset: 47 | X: 0 48 | Y: 0 49 | Z: 0 50 | Plane: XY 51 | Plane Cell Count: 200 52 | Reference Frame: 53 | Value: true 54 | - Alpha: 1 55 | Class: rviz/RobotModel 56 | Collision Enabled: false 57 | Enabled: true 58 | Links: 59 | All Links Enabled: true 60 | Expand Joint Details: false 61 | Expand Link Details: false 62 | Expand Tree: false 63 | Link Tree Style: Links in Alphabetic Order 64 | base_link: 65 | Alpha: 1 66 | Show Axes: false 67 | Show Trail: false 68 | Value: true 69 | gps: 70 | Alpha: 1 71 | Show Axes: false 72 | Show Trail: false 73 | imu_link: 74 | Alpha: 1 75 | Show Axes: false 76 | Show Trail: false 77 | prop_left: 78 | Alpha: 1 79 | Show Axes: false 80 | Show Trail: false 81 | Value: true 82 | prop_right: 83 | Alpha: 1 84 | Show Axes: false 85 | Show Trail: false 86 | Value: true 87 | Name: RobotModel 88 | Robot Description: robot_description 89 | TF Prefix: "" 90 | Update Interval: 0 91 | Value: true 92 | Visual Enabled: true 93 | - Class: rviz/TF 94 | Enabled: true 95 | Frame Timeout: 15 96 | Frames: 97 | All Enabled: false 98 | base_link: 99 | Value: true 100 | gps: 101 | Value: false 102 | imu_link: 103 | Value: false 104 | map: 105 | Value: true 106 | odom: 107 | Value: true 108 | prop_left: 109 | Value: false 110 | prop_right: 111 | Value: false 112 | world: 113 | Value: true 114 | Marker Alpha: 1 115 | Marker Scale: 3 116 | Name: TF 117 | Show Arrows: true 118 | Show Axes: true 119 | Show Names: true 120 | Tree: 121 | world: 122 | map: 123 | odom: 124 | base_link: 125 | gps: 126 | {} 127 | imu_link: 128 | {} 129 | prop_left: 130 | {} 131 | prop_right: 132 | {} 133 | Update Interval: 0 134 | Value: true 135 | - Alpha: 0.699999988079071 136 | Blocks: 4 137 | Class: rviz_plugins/AerialMapDisplay 138 | Draw Behind: true 139 | Enabled: true 140 | Name: AerialMapDisplay 141 | Object URI: https://tile.openstreetmap.org/{z}/{x}/{y}.png 142 | Topic: /navsat_simple/origin_fix 143 | Value: true 144 | Zoom: 19 145 | - Alpha: 1 146 | Buffer Length: 1 147 | Class: rviz/Path 148 | Color: 25; 255; 0 149 | Enabled: true 150 | Head Diameter: 0.30000001192092896 151 | Head Length: 0.20000000298023224 152 | Length: 0.30000001192092896 153 | Line Style: Lines 154 | Line Width: 0.029999999329447746 155 | Name: Path 156 | Offset: 157 | X: 0 158 | Y: 0 159 | Z: 0 160 | Pose Color: 255; 85; 255 161 | Pose Style: None 162 | Queue Size: 10 163 | Radius: 0.029999999329447746 164 | Shaft Diameter: 0.10000000149011612 165 | Shaft Length: 0.10000000149011612 166 | Topic: /nav/plan 167 | Unreliable: false 168 | Value: true 169 | - Class: rviz/MarkerArray 170 | Enabled: true 171 | Marker Topic: /nav/markers 172 | Name: MarkerArray 173 | Namespaces: 174 | {} 175 | Queue Size: 100 176 | Value: true 177 | - Alpha: 1 178 | Axes Length: 1 179 | Axes Radius: 0.10000000149011612 180 | Class: rviz/PoseWithCovariance 181 | Color: 255; 25; 0 182 | Covariance: 183 | Orientation: 184 | Alpha: 0.5 185 | Color: 255; 255; 127 186 | Color Style: Unique 187 | Frame: Local 188 | Offset: 1 189 | Scale: 1 190 | Value: true 191 | Position: 192 | Alpha: 0.30000001192092896 193 | Color: 204; 51; 204 194 | Scale: 1 195 | Value: true 196 | Value: true 197 | Enabled: true 198 | Head Length: 0.30000001192092896 199 | Head Radius: 0.10000000149011612 200 | Name: PoseWithCovariance 201 | Queue Size: 10 202 | Shaft Length: 1 203 | Shaft Radius: 0.05000000074505806 204 | Shape: Arrow 205 | Topic: /navsat_simple/raw_pose 206 | Unreliable: false 207 | Value: true 208 | Enabled: true 209 | Global Options: 210 | Background Color: 48; 57; 62 211 | Default Light: true 212 | Fixed Frame: map 213 | Frame Rate: 30 214 | Name: root 215 | Tools: 216 | - Class: rviz/Interact 217 | Hide Inactive Objects: true 218 | - Class: rviz/MoveCamera 219 | - Class: rviz/Select 220 | - Class: rviz/FocusCamera 221 | - Class: rviz/Measure 222 | - Class: rviz/SetInitialPose 223 | Theta std deviation: 0.2617993950843811 224 | Topic: /initialpose 225 | X std deviation: 0.5 226 | Y std deviation: 0.5 227 | - Class: rviz/SetGoal 228 | Topic: /move_base_simple/goal 229 | - Class: rviz/PublishPoint 230 | Single click: true 231 | Topic: /clicked_point 232 | Value: true 233 | Views: 234 | Current: 235 | Class: rviz/Orbit 236 | Distance: 33.409080505371094 237 | Enable Stereo Rendering: 238 | Stereo Eye Separation: 0.05999999865889549 239 | Stereo Focal Distance: 1 240 | Swap Stereo Eyes: false 241 | Value: false 242 | Field of View: 0.7853981852531433 243 | Focal Point: 244 | X: 1.7178369760513306 245 | Y: 11.672297477722168 246 | Z: -16.395109176635742 247 | Focal Shape Fixed Size: false 248 | Focal Shape Size: 0.05000000074505806 249 | Invert Z Axis: false 250 | Name: Current View 251 | Near Clip Distance: 0.009999999776482582 252 | Pitch: 0.9947971105575562 253 | Target Frame: 254 | Yaw: 4.880396842956543 255 | Saved: ~ 256 | Window Geometry: 257 | Displays: 258 | collapsed: false 259 | Height: 981 260 | Hide Left Dock: false 261 | Hide Right Dock: true 262 | QMainWindow State: 000000ff00000000fd00000004000000000000016a00000315fc020000000afb0000001200530065006c0065006300740069006f006e00000001e10000009b0000007901000003fb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000004600000315000000ff01000003fb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000a0049006d0061006700650000000258000000ab0000000000000000fb0000000a0049006d006100670065000000023c000000c500000000000000000000000100000110000002b7fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a005600690065007700730000000046000002b7000000d701000003fb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004e200000050fc0100000002fb0000000800540069006d00650100000000000004e2000002d701000003fb0000000800540069006d00650100000000000004500000000000000000000003770000031500000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 263 | Selection: 264 | collapsed: false 265 | Time: 266 | collapsed: false 267 | Tool Properties: 268 | collapsed: false 269 | Views: 270 | collapsed: true 271 | Width: 1250 272 | X: 670 273 | Y: 0 274 | --------------------------------------------------------------------------------