Merge pull request #1 in MITL/mmwave_ti_ros from feature/MMWAVE_APPS-571-combine-autonomous-and-safety-bubble-folder-into-single-folder to master

* commit '20844f3d121d8481555338c5bbebcae4e1f5da2d':
  Fixed broken links
  Changed to folder structure
  moved ros_driver to /src/, updated all docs for turtlebot merge
  complete merged source of turtlebot labs
This commit is contained in:
Yogesh Siraswar
2021-01-14 15:25:42 -06:00
625 changed files with 7117 additions and 4136 deletions

View File

@@ -1,579 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Autonomous Robotics with ROS for mmWave User's Guide - Version 1.6 </title>
</head>
<!-- START PRE -->
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/fonts/ubuntu-regular-woff.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/fonts/glyphicons-halflings-regular.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/themes/united2.min.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/themes/bootstrap-responsive.min.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/strapdown.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/styles/link.css"/>
<!-- END PRE -->
<xmp style="display:none;" class="col-xs-6">
Autonomous Robotics with ROS for mmWave
===========
This lab allows for the TI mmWave sensor to be used with popular mapping and navigation libraries in the Robot Operating System (ROS) environment, familiar to many robotics engineers.
The lab uses the Octomap server and move_base libraries with TIs mmWave ROS Driver Package software to interface to the TI mmWave sensor. The lab supports use of IWR6843ISK or IWR6843AOP ES2.0 EVMs.
With this TI driver and the software from the ROS community (ros.org) engineers may evaluate robot navigation and object avoidance quickly and easily.
<img src="images/intro_senseavoid.gif" class="img-responsive"/>
# Requirements
### Prerequisite
[[y! Run Out of Box Demo
Before continuing with this lab, users should first run the out of box demo for the EVM.
This will enable users to gain familiarity with the sensor's capabilities as well as the various tools used across all labs in the mmWave Industrial Toolbox. ]]
### Required and Supported mmWave Evaluation Modules (EVM)
#### ISK module with MMWAVEICBOOST
Quantity | Item
------------------|-----------------
1 | Antenna Module Board: [IWR6843ISK](http://www.ti.com/tool/IWR6843ISK)
1 | OPTIONAL: [Industrial mmWave Carrier Board](http://www.ti.com/tool/MMWAVEICBOOST) for CCS based debugging
OR
#### AOP EVM
Quantity | Item
------------------|-----------------
1 | [IWR6843AOPEVM](http://www.ti.com/tool/IWR6843AOPEVM)
1 | OPTIONAL: [Industrial mmWave Carrier Board](http://www.ti.com/tool/MMWAVEICBOOST) for CCS based debugging
[[r! IWR6843 ES2.0 Only
This lab is only compatible with ES2.0 version of IWR6843.
On ISK or ODS, check the device version on your IWR6843 using the on-chip device markings as shown below
1. If line 4 reads `678A`, you have an ES2 device. In this case, this lab is compatible with your EVM.
2. If line 4 reads `60 GHZi`, you have an older ES1 device. In this case, the lab is NOT compatible with your EVM. ES2 IWR6843ISK/IWR6843ISK-ODS boards are orderable from the EVM link above.
<img src="images/iwr6843_silicon_revision.png" width="300"/>
On AOP, the EVM must be Rev F or later. This can be distinguished by the shape of the EVM if it is as shown above.
]]
[[r! AoP ES2.0 EVM only
The IWR6843 AoP version of this lab is only compatible with ES2.0 silicon and the corresponding EVM. Please ensure your EVM is the same as in the below image.
<img src="images/iwr6843aopevm1.png" width="300"/>
]]
### Additional Hardware Requirements
Quantity | Item | Details
---------|--------------------------|-----------------
1 | Robot | [TurtleBot2](https://www.turtlebot.com/turtlebot2/) with plate and standoff kit
1 | Computer (preferably laptop) | Running Linux Ubuntu 16.04. Used for remote operation and visualization
1 | Laptop<span style="color:blue">*</span> | Used on Turtlebot2. Running Linux Ubuntu 16.04.
1 | USB 2.0 printer-style cable (A-Male to B-Male) | Used to connect laptop to Turtlebot2
1 | Micro USB Cable | Used to connect laptop to the mmWave EVM (cable comes with the EVM and should be connected to XDS110 USB port on EVM)
1 | 12V to 5V DC to DC converter | Must be able to output at least 2.5Amps at 5V. Used to allow the EVM to be powered from the Turtlebot2 (this converter is required since the normal 5V output port on the TurtleBot2 cannot supply 2.5Amps)
1 | 2-pin miniFit JR connector/cable | Used to go from Turtlebot2 12V output port to the 12V input on the converter (for example, Molex cable part number 245135-0210 or 245135-0220 can be used by cutting it in half so the connector end goes to the TurtleBot2 12V output port and the cut wire end goes to the 12V input of the converter)
1 | 2.1mm barrel jack connector | Center positive with cable/wire to go from the 5V output on the converter to the EVM
| Misc. small bolts and nuts and brackets | For mounting mmWave sensor and DC converter to TurtleBot platform (not included with EVM or TurtleBot)
[[b *Sitara AM572x processor can be used instead of a laptop for the Turtlebot2
For instructions on how to implement the Sitara based alternative please refer to the [Autonomous robotics reference design with Sitara™ processors and mmWave sensors using ROS](http://www.ti.com/tool/TIDEP-01006).
The reference design demonstrates an embedded robotic system where point-cloud data from the mmWave radar sensing is processed by the Sitara AM57x processor which runs Robot Operating System (ROS) and is the main processor for the overall system control.
]]
### Software
Tool | Version | Download Link
----------------------------|---------------------------|--------
TI mmWave SDK | 3.4.x.x | [Link to Latest mmWave SDK](http://software-dl.ti.com/ra-processors/esd/MMWAVE-SDK/latest/index_FDS.html). To access a previous version of the mmWave SDK scroll to the bottom of the table and click the link under "MMWAVE-SDK previous release". Repeat to continue stepping back to previous versions.
mmWave Industrial Toolbox | Latest | Download and install the toolbox. Go to [Using TI Resource Explorer & the mmWave Industrial Toolbox](../../../../docs/readme.html) for instructions.
Uniflash | Latest | Uniflash tool is used for flashing TI mmWave Radar devices. [Download offline tool](http://www.ti.com/tool/UNIFLASH) or use the [Cloud version](https://dev.ti.com/uniflash/#!/)
Silicon Labs CP210x USB to UART Bridge VCP Drivers | Latest | Only needed for AOP EVM. [https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers)
-----------
### Laptops
Both laptops need to have:
* Linux Ubuntu 16.04 natively installed (Ubuntu 16.04 Virtual Machine running on Windows can be used for remote control laptop if desired)
* ROS Kinetic Kame LTS with specified ROS packages
* TI mmWave ROS Driver
* Additional ROS packages supplied with this lab
Quickstart
===========
The quickstart guide will cover setting up the EVM, flashing firmware, and running the demo.
## 1. Setup the EVM for Flashing Mode
* For MMWAVEICBOOST + Antenna Module setup: Follow the instructions for [Hardware Setup for Flashing in MMWAVEICBOOST Mode](../../../common/docs/hardware_setup/hw_setup_mmwaveicboost_mode_flashing.html)
* For IWR6843ISK in Standalone/Modular Mode: Follow the instructions for [Hardware Setup of IWR6843ISK for Flashing Mode](../../../common/docs/hardware_setup/hw_setup_isk_ods_modular_mode_flashing.html)
* For AOP in Standalone/Modular Mode: Follow the instructions for [Hardware Setup of IWR6843AOPEVM for Flashing Mode](../../../common/docs/hardware_setup/hw_setup_aop_modular_mode_flashing.html)
## 2. Flash the EVM using Uniflash
Flash the binary listed below using UniFlash. Follow the instructions for [using UniFlash](../../../common/docs/software_setup/using_uniflash_with_mmwave.html)
BIN Name | Board | Location
------------------------------|-----------------|-----------
xwr68xx_mmw_demo.bin | IWR6843ISK | `<INDUSTRIAL_TOOLBOX_INSTALL_DIR>\mmwave_industrial_toolbox_<VER>\out_of_box_demo\`<br>`68xx_mmwave_sdk_dsp\prebuilt_binaries\xwr68xx_mmw_demo.bin`
xwr64xxAOP_mmw_demo.bin | IWR6843AOPEVM | `<INDUSTRIAL_TOOLBOX_INSTALL_DIR>\mmwave_industrial_toolbox_<VER>\out_of_box_demo\`<br>`68xx_aop_mmwave_sdk_hwa\prebuilt_binaries\xwr64xxAOP_mmw_demo.bin`
## 3. Setup the EVM for Functional Mode
* For MMWAVEICBOOST + Antenna Module setup: Follow the instructions for [Hardware Setup of MMWAVEICBOOST + Antenna Module for Functional Mode](../../../common/docs/hardware_setup/hw_setup_mmwaveicboost_mode_functional.html)
* For IWR6843ISK in Standalone/Modular Mode: Follow the instructions for [Hardware Setup of IWR6843ISK for Functional Mode](../../../common/docs/hardware_setup/hw_setup_isk_ods_modular_mode_functional.html)
* For AOP: follow the instructions for [Hardware Setup of IWR6843AOPEVM for Functional Mode](../../../common/docs/hardware_setup/hw_setup_aop_modular_mode_functional.html)
## 4. Verification using online Visualizer
-----------
* Power up the EVM and connect it to the Windows PC with the provided USB cable (make sure that the SOP2 jumper is removed).
* Using Google Chrome, navigate to the following URL: https://dev.ti.com/mmWaveDemoVisualizer
* If prompted, follow the on-screen instructions for installing TI Cloud Agent (this is need the first time on a new PC)
* In the GUI menu, select Options &rarr; Serial Port
* In the serial port window, enter the appropriate port in each of the drop down menus based on your port numbers from the "flash the evm" section
* Click on Configure to connect the GUI to the EVM. The GUI Status bar should show <b>Conected:</b> <img src="images/mmwave_demo_visualizer_connected.png" width="30" height="20"/>
<img src="images/mmwave_demo_visualizer_ports.png" width="600"/>
## 4. Setting up the TurtleBot2
-----------
* The TurtleBot2 is a low-cost, personal robotics platform that is well supported within the ROS
community. There are many existing demos that work out-of-the-box with the TurtleBot2 including
teleoperation (remote control), mapping, and navigation.
* In this guide we will have a look at how to modify these demos to integrate the TI mmWave sensor as the 3-D sensor.
* The TurtleBot2 should be assembled and mmWave EVM mounted as shown in the following pictures to work with this lab. There may be slight variation in mounting depending on EVM option.
* In the example shown, the 12V to 5V converter is mounted underneath the center of the top plate.
* The Turtlebot and EVM is connected to the laptop using USB cables
IWR6843ISK with MMWAVEICBOOST carrier board front view (shown without required laptop):
<img src="images/setup/turtlebot2_front.png" class="img-responsive"/>
IWR6843ISK with MMWAVEICBOOST carrier board side view (shown without required laptop):
<img src="images/setup/turtlebot2_side.png" class="img-responsive"/>
## 5. Installing ROS and the TI mmWave ROS Driver
---------------
* Please follow the instructions in the TI mmWave ROS Driver Setup Guide (available on the **TI Resource Explorer under Labs > TI mmWave ROS Driver**) to install ROS and the TI mmWave ROS Driver on each laptop before continuing.
* ROS must be installed on both the TurtleBot laptop and the Remote Control laptop.
* It is a good idea to test out the installation on each laptop by connecting the TI mmWave EVM and trying out the point cloud visualization.
## 6. Installing the mmWave Mapping and Navigation Demo Packages
---------------
After installing ROS and the TI mmWave ROS Driver, follow the steps below on both laptops for interchangeability.
Install the Required Dependent ROS Packages
1. Install the following ROS packages which are required dependencies to run the demos:
```
$ sudo apt-get install ros-kinetic-navigation
```
```
$ sudo apt-get install ros-kinetic-hector-slam
```
```
$ sudo apt-get install ros-kinetic-octomap-server
```
```
$ sudo apt-get install ros-kinetic-kobuki
```
```
$ sudo apt-get install ros-kinetic-octomap-rviz-plugins
```
```
$ sudo apt-get install ros-kinetic-vision-opencv
```
```
$ sudo apt-get install ros-kinetic-depth-image-proc
```
```
$ sudo apt-get install ros-kinetic-joy
```
2. Download the source code for the specific version of the ROS fake_localization package required
to run the demos:
```
$ mkdir -p ~/catkin_ws/src/navigation/fake_localization
```
```
$ cd ~/catkin_ws/src/navigation/fake_localization
```
```
$ wget https://raw.githubusercontent.com/ros-planning/navigation/1.14.2/fake_localization/fake_localization.cpp
```
```
$ wget https://raw.githubusercontent.com/ros-planning/navigation/1.14.2/fake_localization/CMakeLists.txt
```
```
$ wget https://raw.githubusercontent.com/ros-planning/navigation/1.14.2/fake_localization/package.xml
```
## 7. Download the TurtleBot mmWave Mapping and Navigation Packages
---------------
1. Download the **ti\_mmwave\_ros\_map\_nav\_`<ver>`.tar.gz** Linux archive file from the
<a href="javascript:void(0)" onclick="window.parent.jumpToTirexNodeInCurrentPackage (' AN-1gXp4Kn1RRFC9mOFTZQ ')"> Robotics </a> / Autonomous Robotics with ROS for mmWave folder and copy it to your catkin `<workspace_dir>/src` directory.
[[y! Note
Downloading and extracting the TurtleBot mmWave Mapping and Navigation Packages should be done on both laptops
]]
a) Point your web browser to the mmwave sensor software package: https://dev.ti.com/tirex/#/?link=Software
b) Click on “mmWave Sensors” and then click on “Industrial Toolbox”
c) Click on the link for “Labs”
d) Click on the “Autonomous Robotics with ROS for mmWave” lab in the table in the center
e) Click on the “Download All” button on the right side as shown in the following
image and accept the user license agreement when prompted. Choose to save the
downloaded zip file if prompted or save it to disk first and then open it by doubleclicking
it from the downloaded location.
<img src="images/setup_sw/download_lab.png" class="img-responsive"/>
f) Navigate into the folder structure of the opened zip file to the path shown in the
following figure. (Note that the path may start with mmwave\_sensors/industrial\_toolbox\_<ver> depending on package version.)
<img src="images/setup_sw/ros_pkg_source.png" class="img-responsive"/>
g) Open a new file browser window and navigate to your catkin `<workspace_dir>/src`
directory as shown in the right window in the following screenshot. Copy the
**ti\_mmwave\_ros\_map\_nav\_`<ver>`.tar.gz** file to your `<workspace_dir>/src` directory
by dragging it from the source (left) window to the destination (right) window.
<img src="images/setup_sw/ros_pkg_dest.png" class="img-responsive"/>
h) You should now see the **ti\_mmwave\_ros\_map\_nav\_`<ver>`.tar.gz** file in your
`<workspace_dir>/src` directory as shown in the following screenshot.
<img src="images/setup_sw/ros_pkg_in_src.png" class="img-responsive"/>
2. Extract the turtlebot, navigation, and turtlebot\_mmwave\_launchers folders (as well as a
custom mmWave chirp config file which gets placed in the ti_mmwave_rospkg/cfg
directory) from the archive (.tar.gz) file using the following command executed from the
`<workspace_dir>/src` directory. Change <ver> to match the actual filename.
```
$ tar xzf ti_mmwave_ros_map_nav_<ver>.tar.gz
```
3. Go back to your catkin `<workspace_dir>` directory and build the workspace:
```
$ cd <workspace_dir>
```
```
$ catkin_make
```
If all of the installation steps were followed and both ROS environment scripts were sourced
the driver should build successfully and you should see [100%] on the lines at the end of the
build output.
## 8. Networking
---------------
ROS is a distributed system, meaning that it can communicate over a local network with other ROS
components. For this demo, both laptops mentioned above must be on the exact same network and
must be able to ping (icmp) each other by IP address. The Remote Control laptop must also be able to
ssh (tcp/ip) into the TurtleBot laptop by IP address. You may need to install ssh on the laptops using the
following command:
```
$ sudo apt-get install ssh
```
For more information regarding ROSs networking visit the link: <http://wiki.ros.org/ROS/NetworkSetup>
Additionally a ROS system may only have one “roscore” across all machines. In order for machines to
recognize this “roscore” they must have an environment variable defined which specifies the IP address
of the “roscore” machine.
###On the TurtleBot machine
Edit your **~/.bashrc** file to include the following lines at the bottom:
```
export ROS_MASTER_URI=http://localhost:11311
export ROS_IP=<IP_OF_THIS_MACHINE>
```
You can check your IP by running `$ ifconfig` on the command line. Note that the line
exporting the ROS_IP environment variable may not be required if your network is setup where
each machine can contact/ping the other by hostname. You must close and re-open the shell
for the updated **~/.bashrc** file to take effect.
###On the Remote machine
Edit your **~/.bashrc** file to include the following lines at the bottom:
```
export ROS_MASTER_URI=http://<IP_OF_TURTLEBOT_MACHINE>:11311
export ROS_IP=<IP_OF_THIS_MACHINE>
```
You can check your IP by running `$ ifconfig` on the command line. Note that if your network
is setup where each machine can contact/ping the other by hostname then you can use
<NAME_OF_TURTLEBOT_MACHINE> instead of <IP_OF_TURTLEBOT_MACHINE> in the first line
and the line exporting the ROS_IP environment variable may not be required. You must close
and re-open the shell for the updated **~/.bashrc** file to take effect.
## 9. Remote Control Demo (TurtleBot Bring-up and Teleoperation)
---------------
These steps must take place from the remote machine, “ssh-ing” into the TurtleBot laptop when
necessary.
##TurtleBot Bring-up
To start the TurtleBot, open a terminal window on the remote machine, ssh into the TurtleBot laptop
and run the following command.
* For IWR6843ISK:
```
$ roslaunch turtlebot_bringup minimal.launch mmwave_device:=6843ISK
```
* For IWR6843AOP:
```
$ roslaunch turtlebot_bringup minimal.launch mmwave_device:=6843AOP
```
If the EVM was not in a good state the roslaunch command will fail. Try resetting the EVM by pressing
the NRST button on the EVM and then run the desired roslaunch command again.
After the Turtlebot and mmWave sensor are configured, you may see periodic “Kobuki : malformed subpayload
detected” errors. These errors appear to come from the Turtlebot driver and do not affect the
operation of the demo.
##Teleoperation (Remote Control)
Open a new terminal window on the remote machine and run the following command to bring up the
teleoperation (remote control) of the TurtleBot:
```
$ roslaunch turtlebot_teleop keyboard_teleop.launch
```
Follow the instructions shown in the window to control the TurtleBot. You can exit out of the remote
control application by pressing `CTRL-C`.
## 10. Mapping Demo
---------------
The Mapping Demo is an example of how to use TIs mmWave Radar EVMs within the ROS framework
on a robot to build a map.
* The demo runs the octomap_server package in ROS. There are several filters that have been brought up
for use: Pass Through filters for all the point cloud fields, and a Statistical Outlier Removal filter for
filtering the raw map.
* **Pass Through Filters**: remove values outside a certain range for a given field (X, Y, Z, intensity)
* **Statistical Outlier Removal**: removes values based off their distance from their closest neighbors
* The parameters/limits for these filters can be found and modified in the
**turtlebot\_mmwave\_launchers/launch/radar\_limit\_filters.launch** file. The **radar_mapping.launch** file
mentioned below must be re-started after changing the **radar_limit_filters.launch** file in order for the
new parameters to take effect.
The processing graph for the incoming point cloud data is shown below:
<img src="images/setup_sw/ros_processing_graph.png" class="img-responsive"/>
##Start-up
To run the mapping demo, first follow the TurtleBot Bring-up and Remote Control instructions in the
“TurtleBot Bring-up and Teleoperation (Remote Control)” section to bring up and remote control the
TurtleBot. Then, to run the mapping demo open a new terminal window, ssh into the TurtleBot laptop
and run the following command:
```
$ roslaunch turtlebot_mmwave_launchers radar_mapping.launch
```
You may see a few warnings immediately after the launch file is run. It may also output a warning saying
“Nothing to publish, octree is empty” whenever there are no objects detected in front of the mmWave
sensor.
##Visualization
To view the TurtleBot, Radar data, and map data in Rviz open a new terminal window on the remote
machine and run the following command which will open a pre-defined Rviz configuration customized
for the mapping demo (the command is all one line):
```
$ rosrun rviz rviz -d ~/catkin_ws/src/turtlebot_mmwave_launchers/launch/mapping_visualization.rviz
```
Alternatively, you can run the following command to open a blank Rviz screen and then manually add
the same topics to the visualization as follows:
```
$ rosrun rviz rviz
```
* Once Rviz has started, add the radar data by selecting Add-> PointCloud2 and selecting /mmWaveDataHdl/RScan under the Topic dropdown menu for the PointCloud2.
* Make the following changes to improve the visualiation:
* Size to 0.03
* Style to Spheres
* Decay to 0.25
* To visualize the TurtleBot on the screen select Add->Robot Model and Rviz will automatically detect the robot
description and display the TurtleBot.
* To view the path the TurtleBot is taking select Add->Path and choose /trajectory under the Topic dropdown for the Path.
* To visualize the octomap output in Rviz, select Add->PointCloud2 and select `<raw_or_filtered>_point_cloud_centers`
* To color points by elevation change ColorTransformer to AxisColor.
* Changing the Size to 0.03 and Style to Spheres will improve the visualization.
You can also save a custom Rviz configuration and load it in the future for convenience.
##Saving a Map
* The TurtleBot laptop is now running the Radar and TurtleBot drivers, as well as all the filtering and
mapping nodes shown in the flow chart above.
* Move the TurtleBot around your environment manually until you are satisfied with your map.
* Then open a new terminal window on the remote machine, ssh into the TurtleBot laptop, and run the following command to save the map:
```
$ rosrun octomap_server octomap_saver f <your_file_name>.bt
```
##Viewing a Previously Saved Map
* To view a saved `<map>.bt` file, you must first shutdown the mapping demo launch file if it was launched
by pressing CTRL-C in the window where the radar_mapping.launch file was launched.
* Rviz will need to be opened and configured as mentioned in the Visualization section above if it is not already open.
* Then, open a new terminal window on the remote machine, ssh into the TurtleBot laptop, and run the following command to serve the saved map (the command is all one line):
```
$ rosrun octomap_server octomap_server_node /path/to/<map>.bt octomap_point_cloud_centers:=filtered_point_cloud_centers
```
You should see the saved map displayed in Rviz. Note that the other topics in Rviz may show a
warning/error since they are not active.
## 11. Navigation Demo
---------------
The TurtleBot navigation demo runs on the nodes mentioned in the image below.
<img src="images/setup_sw/ros_nodes.png" class="img-responsive"/>
Here are the steps to run the navigation demo.
1. Close all previous terminal windows if any were open
2. Open a new terminal window on the remote machine, ssh into the TurtleBot laptop and bring up the
TurtleBot and mmWave EVM with the following command.
* For IWR6843ISK:
```
$ roslaunch turtlebot_bringup minimal.launch mmwave_device:=6843ISK
```
* For IWR6843AOP:
```
$ roslaunch turtlebot_bringup minimal.launch mmwave_device:=6843AOP
```
If the EVM was not in a good state the roslaunch command will fail. Try resetting the EVM by
pressing the NRST button on the EVM and then run the desired roslaunch command again.
The configuration files are included in the ti_mmwave_ros_map_nav_v1p4.tar.gz package ...\ti_mmwave_ros_map_nav_v1p4\ti_mmwave_rospkg\cfg. To change the parameter, edit and save the file using a text editor. For example, to update the demo to run using the IWR6843ISK-ODS and configuration file used with the ODS point cloud demo
- Edit the "6843ISK_3d.cfg" configuration file to one that works with the ODS point cloud demo.
- Flash the IWR6843ISK-ODS with the ODS point cloud binary.
- Run the demo as documented for 6843ISK EVM.
3. To bring up the move_base and fake_localization nodes and load a prebuilt map using the
octomap_server, open a new terminal window on the remote machine, ssh into the TurtleBot
laptop and run the following command:
```
$ roslaunch turtlebot_mmwave_launchers radar_navigation.launch
```
**Note 1**: By default, this launch file loads a specific prebuilt map file containing a map of a simple
rectangular space roughly 4ft x 6ft which can be used to make the robot stay within a space of that
size for demo and testing purposes.
* To load your own map, edit the radar_navigation.launch file and change the map filename shown in
bold below to your own saved map file.
*node name="octomap_server" pkg="octomap_server" type="octomap_server_node" args**="$(find
turtlebot_mmwave_launchers)/launch/map_4ft_by_6ft_border_large.bt** projected_map:=map" />*
* Alternatively, this static map can be completely disabled/removed as follows if desired to allow the
robot to plan paths freely without any artificial boundaries.
* Remove the line containing “costmap_2d::StaticLayer” in the global_costmap_params.yaml
and local_costmap_params.yaml param files
* Remove the line containing “octomap_server_node” in the ~catkin_ws/src/turtlebot_mmwave_launchers/launch/radar_navigation.launch file
* The size of the global and local costmaps can also be increased in the global_costmap_params.yaml and local_costmap_params.yaml param files to allow setting goals that are farther away
**Note2**: You may see “octree is empty” warnings when there are no objects detected in front of the mmWave sensor.
4. Open a new terminal window on the remote machine and run the following command which will
open a pre-defined Rviz configuration customized for the navigation demo.
* To show the inflation layer which is used for path planning (the command is all one line):
```
$ rosrun rviz rviz -d ~/catkin_ws/src/turtlebot_mmwave_launchers/launch/navigation_visualization.rviz
```
* To not show the inflation layer which is used for path planning (the command is all one line):
```
$ rosrun rviz rviz -d ~/catkin_ws/src/turtlebot_mmwave_launchers/launch/navigation_visualization_2.rviz
```
* Alternatively, you can run the following command to open a blank Rviz screen and then manually add the same topics to the visualization as follows:
```
$ rosrun rviz rviz
```
* “Add” three Map displays, one PointCloud2, the Robot Model, and one PosewithCovariance. Use the
Topic dropdowns on the displays you added in Rviz to select topics for each one.
* For the maps, choose “map” for one and the local and global cost maps for the other two.
* Select /initialpose for PosewithCovariance.
* You can select /mmWaveDataHdl/RScan or /xyzi_filt_out for the PointCloud2.
* Changing the Size to 0.03, Style to Spheres, and Decay to 0.25 will improve the PointCloud2 visualization.
* You can also add two Path topics (one for /move_base/DWAPlannerROS/local_plan and one for /move_base/DWAPlannerROS/global_plan) and a Polygon for /move_base/local_costmap/footprint.
* There is also an alternate pre-defined Rviz configuration file as an additional visualization example
located at “turtlebot_mmwave_launchers/launch/navigation_visualization_2.rviz” that adds a PointCloud for the voxel grid (/move_base/local_costmap/obstacle_layer/marked_cloud) and disables the costmaps.
5. Start the navigation by first providing an initial pose estimate. Select 2D Pose Estimate (along the
top of screen) and click on the location where the TurtleBot is within the map and drag in the
direction it is facing. You should see the TurtleBot appear on the same spot you click immediately
after releasing.
Note: Please do not choose a starting position or goal that is too close to the boundaries of the
current map as the navigation stack will not be able to create what it considers to be a valid path.
6. Now, give the TurtleBot a navigation goal by selecting 2D Nav Goal and clicking the location you
would like the TurtleBot to navigate towards and dragging in the direction you would like it to face.
The TurtleBot should then begin navigation to its goal. If you need to stop it, terminate the
radar_navigation.launch roslaunch command by clicking on the terminal window that was used to
launch it and pressing CTRL-C.
7. As an alternative to manually specifying the initial pose and goal using Rviz, there is also an example
shell script in the “turtlebot_mmwave_launchers/scripts” directory that you can call from the Linux
command prompt to set the initial pose and goal. It is intended to be used with the default 4ft x 6ft
prebuilt map where you start the robot on one of three starting points (a, b, or c) at one end of the
rectangular space facing the opposite end and then send it to one of the three goal points at the
other end. This is useful for demonstrating obstacle avoidance in a 4ft x 6ft space as shown in the
following picture. To run the script, go to the “turtlebot_mmwave_launchers/scripts” directory and
type “./start_nav.sh” at the Linux prompt.
<img src="images/setup_sw/turtlebot_sense_avoid_setup.png" class="img-responsive"/>
Need More Help?
===========
* Fort Turtlebot2 issues and questions: <http://wiki.ros.org/Robots/TurtleBot#Robots.2BAC8-TurtleBot.2BAC8-kinetic.TurtleBot2>
* For ROS related questions: <https://answers.ros.org/questions/>
* Additional resources in the documentation of the mmWave SDK (note hyperlinks will only work if the mmWave SDK has been installed on PC):
* [mmWave SDK Module Doc located at `<mmwave_sdk_install_dir>/docs/mmwave_sdk_module_documentation.html`](file:///C:/ti/mmwave_sdk_03_04_00_03/docs/mmwave_sdk_module_documentation.html)
* [mmWave SDK User's Guide located at `<mmwave_sdk_install_dir>/docs/mmwave_sdk_user_guide.pdf`](file:///C:/ti/mmwave_sdk_03_04_00_03/docs/mmwave_sdk_user_guide.pdf)
* [mmWave SDK Release Notes located at `<mmwave_sdk_install_dir>/docs/mmwave_sdk_release_notes.pdf`](file:///C:/ti/mmwave_sdk_03_04_00_03/docs/mmwave_sdk_release_notes.pdf)
* Find answers to common questions on [mmWave E2E FAQ](https://e2e.ti.com/support/sensors/f/1023/t/595725)
* Search for your issue or post a new question on the [mmWave E2E forum](https://e2e.ti.com/support/sensor/mmwave_sensors/f/1023)
</xmp>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/highlight/styles/zenburn.css"/>
<script src="../../../../.metadata/.html/scripts/strapdown/vendor/jquery-1.11.2.min.js"></script>
<script src="../../../../.metadata/.html/scripts/strapdown/vendor/bootstrap.min.js"></script>
<script src="../../../../.metadata/.html/scripts/highlight/highlight.pack.js"></script>
<script src="../../../../.metadata/.html/scripts/strapdown/v/0.2/strapdown.js"></script>
<script src="../../../../.metadata/.html/scripts/toolbox.js"></script>
<script src="../../../../.metadata/.html/scripts/toolbox_fixes.js"></script>
</html>

View File

@@ -0,0 +1,311 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>ROS Setup for mmWave User's Guide - Version 1.0 </title>
</head>
<!-- START PRE -->
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/fonts/ubuntu-regular-woff.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/fonts/glyphicons-halflings-regular.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/themes/united2.min.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/themes/bootstrap-responsive.min.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/strapdown.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/styles/link.css"/>
<!-- END PRE -->
<xmp style="display:none;" class="col-xs-6">
Hardware and Software Setup for ROS with TI mmWave
===========
# Requirements
### Prerequisite
[[y! Run Out of Box Demo
Before continuing with this lab, users should first run the out of box demo.
This will enable users to gain familiarity with the sensor's capabilities as well as the various tools used across all labs in the mmWave Industrial Toolbox.
]]
### Required and Supported mmWave Evaluation Modules (EVM)
#### ISK EVM
Quantity | Item
------------------|-----------------
1 or 4 | Antenna Module Board: [IWR6843ISK](http://www.ti.com/tool/IWR6843ISK)
OR
#### AOP EVM
Quantity | Item
------------------|-----------------
1 or 4 | [IWR6843AOPEVM](http://www.ti.com/tool/IWR6843AOPEVM)
[[r! IWR6843 ES2.0 Only
This lab is only compatible with ES2.0 version of IWR6843.
On ISK or ODS, check the device version on your IWR6843 using the on-chip device markings as shown below
1. If line 4 reads `678A`, you have an ES2 device. In this case, this lab is compatible with your EVM.
2. If line 4 reads `60 GHZi`, you have an older ES1 device. In this case, the lab is NOT compatible with your EVM. ES2 IWR6843ISK/IWR6843ISK-ODS boards are orderable from the EVM link above.
<img src="images/iwr6843_silicon_revision.png" width="300"/>
]]
[[r! AoP ES2.0 EVM only
The IWR6843 AoP version of this lab is only compatible with ES2.0 silicon and the corresponding EVM. Please ensure your EVM is the same as in the below image.
<img src="images/iwr6843aopevm1.png" width="300"/>
]]
### Additional Hardware Requirements
Quantity | Item | Details
---------|--------------------------|-----------------
1 | Robot | [TurtleBot2](https://www.turtlebot.com/turtlebot2/) with plate and standoff kit
1 | Local Laptop | Running Linux Ubuntu 16.04. Used for remote operation and visualization
1 | Remote Laptop | Used on Turtlebot2. Running Linux Ubuntu 16.04.
1 | USB 2.0 printer-style cable (A-Male to B-Male) | Used to connect laptop to Turtlebot2
4 | Micro USB Cable | Used to connect laptop to the mmWave EVM (cable comes with the EVM and should be connected to XDS110 USB port on EVM)
1 | 12V to 5V DC to DC converter | Must be able to output at least 4 Amps at 5V. Used to allow the EVM to be powered from the Turtlebot2 (this converter is required since the normal 5V output port on the TurtleBot2 cannot supply 2.5Amps)
1 | USB Splitter with Power Adapter | The remote laptop will likely not have 5 USB ports (4 ports for radar and 1 for turtlebot), so a splitter is necessary.
1 | 2-pin miniFit JR connector/cable | Used to go from Turtlebot2 12V output port to the 12V input on the converter (for example, Molex cable part number 245135-0210 or 245135-0220 can be used by cutting it in half so the connector end goes to the TurtleBot2 12V output port and the cut wire end goes to the 12V input of the converter)
| Misc. bolts, nuts, and brackets | For mounting mmWave sensor and DC converter to TurtleBot platform (not included with EVM or TurtleBot)
### Software
Tool | Version | Download Link
----------------------------|---------------------------|--------
TI mmWave SDK | 3.5.x.x | [Link to Latest mmWave SDK](http://software-dl.ti.com/ra-processors/esd/MMWAVE-SDK/latest/index_FDS.html). To access a previous version of the mmWave SDK scroll to the bottom of the table and click the link under "MMWAVE-SDK previous release". Repeat to continue stepping back to previous versions.
mmWave Industrial Toolbox | Latest | Download and install the toolbox. Go to [Using TI Resource Explorer & the mmWave Industrial Toolbox](../../../../docs/readme.html) for instructions.
Uniflash | Latest | Uniflash tool is used for flashing TI mmWave Radar devices. [Download offline tool](http://www.ti.com/tool/UNIFLASH) or use the [Cloud version](https://dev.ti.com/uniflash/#!/)
-----------
### Laptops
Both laptops need to have:
* Linux Ubuntu 16.04 natively installed (Ubuntu 16.04 Virtual Machine running on Windows can be used for remote control laptop if desired)
* ROS Kinetic Kame LTS with specified ROS packages
* TI mmWave ROS Driver supplied with this lab
* Additional ROS packages supplied with this lab
Setup for ROS Labs
===========
This section of the guide will cover how to setup the hardware and software for ROS Labs.
## 1. Flash Evaluation Modules with Out of Box demo
---------------
Before continuing with this lab, users should first run the Out of Box Demo for all four EVMs. Verify with the
[mmWave Demo Visualizer](https://dev.ti.com/mmWaveDemoVisualizer) that the sensor(s) are working as expected.
## 2. Setting up the TurtleBot2
---------------
* The TurtleBot2 is a low-cost, personal robotics platform that is well supported within the ROS
community. There are many existing demos that work out-of-the-box with the TurtleBot2 including
teleoperation (remote control), mapping, and navigation.
* The TurtleBot2 should be assembled and four mmWave EVM mounted as shown in the following pictures to work with this lab. There may be slight variation in mounting depending on EVM revision.
* In the example shown, the brackets to mount the mmWave EVMs were 3D printed.
* It is essential for this demo to mount the mmWave EVMs every 90 degrees around the robot, equidistant from the center of the robot.
* In the example shown, the 12V to 5V converter is mounted underneath the center of the top plate, and the USB splitter is placed under the top plate.
* The Turtlebot and the four EVMs are connected to the laptop using the USB splitter.
1x IWR6843ISK mounted on the front of the Turtlebot2 with an optional MMWAVEICBOOST:
<img src="images/setup/Turtlebot2_front.png" class="img-responsive"/>
4x IWR6843ISK mounted around the TurtleBot2 top view (shown without required laptop):
<img src="images/setup/Turtlebot2_quad_top.jpg" class="img-responsive"/>
4x IWR6843ISK mounted around the TurtleBot2 side view (shown without required laptop):
<img src="images/setup/Turtlebot2_quad_iso.jpg" class="img-responsive"/>
## 3. Installing ROS and the TI mmWave ROS Driver
---------------
* Please follow the instructions in the TI mmWave ROS Driver Setup Guide (available on the **TI Resource Explorer under Labs > TI mmWave ROS Driver**) to install ROS and the TI mmWave ROS Driver on each laptop before continuing.
* ROS must be installed on both the TurtleBot laptop and the Remote Control laptop.
* It is a good idea to test out the installation on each laptop by connecting the TI mmWave EVM and trying out the point cloud visualization.
## 4. Installing the ROS Mapping and Navigation Demo Packages
---------------
After installing ROS and the TI mmWave ROS Driver, follow the steps below on both laptops for interchangeability.
Install the Required Dependent ROS Packages
[[r! This demo is only supported with ROS Kinetic.
Other versions of ROS are not supported due to limitations with the Turtlebot packages.
]]
1. Install the following ROS packages which are required dependencies to run the demos:
```
$ sudo apt-get install ros-kinetic-navigation
```
```
$ sudo apt-get install ros-kinetic-hector-slam
```
```
$ sudo apt-get install ros-kinetic-octomap-server
```
```
$ sudo apt-get install ros-kinetic-kobuki
```
```
$ sudo apt-get install ros-kinetic-octomap-rviz-plugins
```
```
$ sudo apt-get install ros-kinetic-vision-opencv
```
```
$ sudo apt-get install ros-kinetic-depth-image-proc
```
```
$ sudo apt-get install ros-kinetic-joy
```
## 5. Networking
---------------
ROS is a distributed system, meaning that it can communicate over a local network with other ROS
components. For this demo, both laptops mentioned above must be on the exact same network and
must be able to ping (icmp) each other by IP address. The Remote Control laptop must also be able to
ssh (tcp/ip) into the TurtleBot laptop by IP address. You may need to install ssh on the laptops using the
following command:
```
$ sudo apt-get install ssh
```
If you are not familiar with how to use ssh, please follow this guide: <https://help.ubuntu.com/community/SSH/OpenSSH/ConnectingTo>
For more information regarding ROSs networking visit the link: <http://wiki.ros.org/ROS/NetworkSetup>
Additionally a ROS system may only have one “roscore” across all machines. In order for machines to
recognize this “roscore” they must have an environment variable defined which specifies the IP address
of the “roscore” machine.
###On the TurtleBot machine
Edit your **~/.bashrc** file to include the following lines at the bottom:
```
export ROS_MASTER_URI=http://localhost:11311
export ROS_IP=<IP_OF_THIS_MACHINE>
```
You can check your IP by running `$ ifconfig` on the command line. Note that the line
exporting the ROS_IP environment variable may not be required if your network is setup where
each machine can contact/ping the other by hostname. You must close and re-open the shell
for the updated **~/.bashrc** file to take effect.
###On the Remote machine
Edit your **~/.bashrc** file to include the following lines at the bottom:
```
export ROS_MASTER_URI=http://<IP_OF_TURTLEBOT_MACHINE>:11311
export ROS_IP=<IP_OF_THIS_MACHINE>
```
You can check your IP by running `$ ifconfig` on the command line. Note that if your network
is setup where each machine can contact/ping the other by hostname then you can use
<NAME_OF_TURTLEBOT_MACHINE> instead of <IP_OF_TURTLEBOT_MACHINE> in the first line
and the line exporting the ROS_IP environment variable may not be required. You must close
and re-open the shell for the updated **~/.bashrc** file to take effect.
## 6. Download the TurtleBot mmWave ROS Packages
---------------
<!-- GIT -->
1. The packages for all ROS labs are held on git.ti.com. To download the packages, first ensure that git is installed on your computer.
```
sudo apt-get install git
```
2. Next, download the repository to the user's home directory. Skip this step if the git repository has already been cloned.
```
cd ~ && git clone git.ti.com/
```
3. Change directory to the autonomous_robotics_ros folder. The safety bubble lab is included in the same folder.
```
cd mmwave_ti_ros/autonomous_robotics_ros/
```
3. Build the lab.
```
catkin_make
```
4. Source the setup.bash file
```
source devel/setup.bash
```
## 7. Setup Symbolic Links
---------------
This section is necessary for users who use multiple sensors. Users with a single sensor can skip this step.
When the standalone sensors are plugged into the laptop, the device appears in Ubuntu 16.04 as /dev/ttyUSBx
(Command Port) and /dev/ttyUSBy (Data Port). These names are then used in the launch files to communicate
with the sensor. When using multiple sensors and hardcoding these ttyUSB names, the devices must then be plugged
into the laptop in a specific order. Furthermore, other devices such as the Turtlebot2 may also appear as
/dev/ttyUSBx. Therefore, creating a symbolic link will be extremely useful. Below
are the steps to setting up symbolic links.
[[r! Only works with standalone EVMs
The following steps will not work with the ICBOOST.
]]
1. In a terminal on the remote laptop, create a file named '99-usb-serial.rules' in the directory /etc/udev/rules.d/ with super user:
```
$ sudo nano /etc/udev/rules.d/99-usb-serial.rules
```
2. Type or paste the following:
```
SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea70", SYMLINK+="mmWave_%s{serial}_%E{ID_USB_INTERFACE_NUM}"
```
3. Close and save the file by hitting 'Ctrl+x', then pressing 'y', and finally pressing 'Enter'.
4. Plug in the north sensor to the remote laptop and type the following in the command line:
```
$ ls -l /dev/ | grep mmWave
```
5. Two symolic links should appear. An example would be "mmWave_00CE0FCA_00", typically the command port,
and "mmWave_00CE0FCA_01", typically the data port.
6. Open a file browser to <catkin_ws>/src/ti_mmwave_rospkg/launch/.
7. In the file bubble_sensor_north.launch, change the command_port and data_port to the previously noted symbolic link.
8. Repeat steps 4-7 plugging in each sensor and changing the command_port and data_port fields in the corresponding direction launch files: bubble_sensor_east.launch, bubble_sensor_west.launch, and bubble_sensor_south.launch.
9. Note that these launch files also create a static transform. If the position or angle of the sensors on the robot is different, the arguments in the static transform must be changed. Find more information on static transforms here: [http://wiki.ros.org/tf#static_transform_publisher](http://wiki.ros.org/tf#static_transform_publisher)
This completes the guide on how to get the software and hardware setup for ROS labs. Please return to the respective ROS Lab User's guide to execute the lab.
* [Autonomous Robotics Lab](../../autonomous_robotics_ros/docs/Autonomous_Robotics_with_ROS_for_mmWave_user_guide.html).
* [Safety Bubble Lab](../../safety_bubble/docs/Safety_Bubble_with_ROS_for_mmWave_user_guide.html).
</xmp>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/highlight/styles/zenburn.css"/>
<script src="../../../../.metadata/.html/scripts/strapdown/vendor/jquery-1.11.2.min.js"></script>
<script src="../../../../.metadata/.html/scripts/strapdown/vendor/bootstrap.min.js"></script>
<script src="../../../../.metadata/.html/scripts/highlight/highlight.pack.js"></script>
<script src="../../../../.metadata/.html/scripts/strapdown/v/0.2/strapdown.js"></script>
<script src="../../../../.metadata/.html/scripts/toolbox.js"></script>
<script src="../../../../.metadata/.html/scripts/toolbox_fixes.js"></script>
</html>

View File

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

View File

Before

Width:  |  Height:  |  Size: 179 KiB

After

Width:  |  Height:  |  Size: 179 KiB

View File

Before

Width:  |  Height:  |  Size: 360 KiB

After

Width:  |  Height:  |  Size: 360 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

View File

@@ -0,0 +1,91 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Safety Bubble with ROS for mmWave Release Notes - Version 1.1</title>
</head>
<!-- START PRE -->
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/fonts/ubuntu-regular-woff.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/fonts/glyphicons-halflings-regular.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/themes/united2.min.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/themes/bootstrap-responsive.min.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/strapdown.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/styles/link.css"/>
<!-- END PRE -->
<xmp style="display:none;" class="col-xs-6">
Safety Bubble with ROS for mmWave Release Notes
=============
Overview
========
This lab allows for four TI mmWave sensors and a Turtlebot2 to be used with popular mapping and libraries in the Robot Operating System (ROS) environment, familiar to many robotics engineers.
The lab uses the move_base libraries with TIs mmWave ROS Driver Package software to interface to the TI mmWave sensor. The lab supports use of IWR6843ISK ES2.0 Evaluation Module.
With the TI ROS driver and packages from the ROS community (ros.org) engineers may evaluate robot bubble sensing quickly and easily.
In this lab, the robot will move forward at a defined maximum speed. When an object come within a certain distance
to the robot, the robot will first slow down. If the same object continues to approach the robot, the robot will then stop moving forward.
Once the robot has cleared the object, the robot will speed up again to its maximum speed. It is assumed that the slow zone bubble is larger than the stop zone bubble.
Features
========
* Integrates the TI mmWave ROS driver into the ROS Turtlebot2 platform to allow
the TI mmWave sensor IWR6843ISK EVM to be used as a 3-D sensor
* Allows the driver to be compatible with multiple mmWave sensors.
* Demonstrates mapping using the the TI mmWave sensor with the ROS Octomap
package
* Demonstrates navigation with collision-avoidance using the TI mmWave sensor
with the ROS move_base package
* Creates bubbles around the robot and performs different behavior depending on object distance.
Resolved Incident Reports
=========================
The following are Incident Reports resolved in this release:
* N/A
Known Limitations
============
The following are Known Limitations in this release:
* Currently supported/tested for IWR6843ISK ES2.0 EVM only
* The mmWave EVM must be flashed with:
* The mmWave SDK version 3.5 out-of-box demo firmware for IWR6843ISK ES2.0
* The fake_localization ROS navigation package is used to allow direct setting of
the robots initial pose (position/orientation) and goal pose. Therefore, the
gmapping and amcl ROS navigation packages are not used.
* The robot only moves forward.
* When the robot stops, and after the costmaps are cleared, if an object is still in the stop zone, the robot will suddenly move forward and immediately stop.
Work Arounds for Major Known Issues
===================================
The following are workarounds for each known issue with a major severity that exists in this release:
* N/A
Changes in Version 1.1
========================
The following is a list of changes compared to the previous release.
- Changed instructions to download code from git.ti.com
- Merged source code to Autonomous Robotics Lab.
</xmp>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/highlight/styles/zenburn.css"/>
<script src="../../../../.metadata/.html/scripts/strapdown/vendor/jquery-1.11.2.min.js"></script>
<script src="../../../../.metadata/.html/scripts/strapdown/vendor/bootstrap.min.js"></script>
<script src="../../../../.metadata/.html/scripts/highlight/highlight.pack.js"></script>
<script src="../../../../.metadata/.html/scripts/strapdown/v/0.2/strapdown.js"></script>
<script src="../../../../.metadata/.html/scripts/toolbox.js"></script>
<script src="../../../../.metadata/.html/scripts/toolbox_fixes.js"></script>
</html>

View File

@@ -0,0 +1,158 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Safety Bubble with ROS for mmWave User's Guide - Version 1.1 </title>
</head>
<!-- START PRE -->
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/fonts/ubuntu-regular-woff.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/fonts/glyphicons-halflings-regular.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/themes/united2.min.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/themes/bootstrap-responsive.min.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/strapdown.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/styles/link.css"/>
<!-- END PRE -->
<xmp style="display:none;" class="col-xs-6">
360° Safety Bubble with ROS for mmWave
===========
This lab allows for four TI mmWave sensors and a Turtlebot2 to be used with popular mapping and libraries in the Robot Operating System ([ROS](http://wiki.ros.org/)) environment.
The lab uses the move_base libraries with TIs mmWave ROS Driver Package software to interface to the TI mmWave sensors. The lab supports use of IWR6843ISK ES2.0 Evaluation Module.
With the TI ROS driver and packages from the ROS community (ros.org) engineers may evaluate robot bubble sensing quickly and easily.
In this lab, the robot will move forward at a defined maximum speed. When an object come within a certain distance
to the robot, the robot will first slow down. If the same object continues to approach the robot, the robot will then stop moving forward.
Once the robot has cleared the object, the robot will speed up again to its maximum speed. It is assumed that the slow zone bubble is larger than the stop zone bubble.
Visit this link for an example demonstration: [http://www.ti.com/mmWaveROSsafetybubblevideo](http://www.ti.com/mmWaveROSsafetybubblevideo)
Below is an image depicting how the bubble demonstration functions. Note that the numbers shown in the image are configurable: <img src="images/DemoDesc.PNG" class="img-responsive"/>
To enable a full 360° field of view, four TI mmWave sensors are used. Should users not have access to four sensors, the lab also functions with one sensor. However, a fully surrounding field of view will not be possible.
## Hardware and Software Setup
Before starting the safety bubble demo, please follow the directions described in the [ROS Setup Guide with TI mmWave](../common/Turtlebot_HWSW_setup.html).
This guide will explain which hardware is necessary, how to setup the hardware, and the software installation process.
## 1. Sensor Bubble Demo
---------------
Here are the steps to run the sensor bubble demo.
1. Close all previous terminal windows if any were open.
1. Open a new terminal and change directory to the autonomous_robotics_ros folder provided in the mmwave_ti_ros git repository.
```
cd mmwave_ti_ros/autonomous_robotics_ros
```
2. SSH into the remote laptop, and run the following. If the EVM was not in a good state the roslaunch command will fail. Try resetting the EVM by
pressing the NRST button on the EVM and then run the desired roslaunch command again. The `<device>` tag noted below can be one of the following: `6843ISK` or `6843AOP`.
```
$ roslaunch ti_mmwave_rospkg bubble_sensor_north.launch config:=3d device:=<device>
```
3. If there are no errors, then the north sensor has been configured correctly. Now stop the process by pressing 'Ctrl+C'. Single sensor users can now continue to the next step. For use with four sensors, repeat step 2 three more times but replacing 'bubble_sensor_north.launch'
with 'bubble_sensor_east.launch', 'bubble_sensor_west.launch', and 'bubble_sensor_south.launch', stopping the process with 'Ctrl+C' after each command. This process ensures that each sensor is configured correctly. Skipping this step is not recommended.
4. Open a new terminal window on the remote machine, ssh into the TurtleBot laptop and bring up the
TurtleBot and mmWave EVM with the command below. The `<device>` tag noted below can be one of the following: `6843ISK` or `6843AOP`.
* For setups running a single sensor:
```
$ roslaunch turtlebot_bringup minimal_single_sensor.launch mmwave_device:=<device>
```
* For setups running four sensors:
```
$ roslaunch turtlebot_bringup minimal_quad_sensor.launch mmwave_device:=<device>
```
5. To bring up the move_base and fake_localization nodes, open a new terminal window on the remote machine, ssh into the TurtleBot
laptop and run the following command.
* For single sensor:
```
$ roslaunch turtlebot_mmwave_launchers radar_navigation_single.launch
```
* For quad sensors use:
```
$ roslaunch turtlebot_mmwave_launchers radar_navigation_quad.launch
```
**Note**: You may see “octree is empty” warnings when there are no objects detected in front of the mmWave sensors.
5. At this point, the point clouds for all sensors and the global costmap should be alive. Open a new terminal window on
the remote machine and run the following command which will open a pre-defined Rviz configuration customized for the navigation demo.
* To show the inflation layer which is used for motion control (the command is all one line):
```
$ rosrun rviz rviz -d mmwave_ti_ros/autonomous_robotics_ros/src/turtlebot_mmwave_launchers/launch/bubble_visualization.rviz
```
* To hide the inflation layer and only show the point cloud data:
```
$ rosrun rviz rviz -d mmwave_ti_ros/autonomous_robotics_ros/src/turtlebot_mmwave_launchers/launch/bubble_visualization_2.rviz
```
**Note**: Both options show the point cloud from all four sensors, while each color represents a sensor direction. Specifically, points seen by the north sensor are displayed in purple, east sensor in red, south sensor in blue, and west sensor in orange.
6. Running the following will start the robot moving forward and either slow down or stop for a certain time
depending on whether or not objects are within the slow and stop zones. Both single and quad sensor users can execute:
```
$ roslaunch ti_safety_bubble controller.launch
```
[[r! The robot will now move forward
The robot will stop when an object in front of the north sensor is detected. However, it will continue to move
forward after some time, and then stop again. This process of moving forward and stopping continues until the
program has stopped. Always be ready to terminate the program by pressing Ctrl+C.
]]
# How It Works
---------------
This section will describe how the 360° safety bubble demo works. This lab uses a large portion of the open sourced
[ROS navigation stack](https://wiki.ros.org/navigation) and primarily uses the global costmap. The navigation
stack has been setup to input the point cloud from all 4 mmWave sensors into the global and local costmaps.
The navigation stack does not take control and navigate around the obstacles. Instead, by launching controller.launch,
the odomListener node takes the obstacle information from the global costmap and calculates the distance to the robot.
If the distance is within the slow zone threshold, the node then sends a velocity command to slow down the robot. If the
distance is within the stop zone threshold, a stop velocity is published. Information in the global costmap is always saved,
which is not suitable for moving objects as a history of where the objects has previously been will be stored. Thus is the
need to periodically clear the global costmap. This way only the recent obstacle layer history will be used.
## Configurable Parameters
---------------
1. The size, position, and resolution of the global costmap can be adjusted. To do this, edit the file 'global_costmap_params.yaml' in the path 'turtlebot/turtlebot_apps/turtlebot_navigation/param/'.
2. The size of zone bubbles and the time to clear costmaps are configurable. Zone bubbles are defined as radius from the center of the robot. Edit the parameters "slow_radius", "stop_radius", and "clear_costmap_period_secs" in controller.launch in the path 'ti_safety_bubble/launch/'.
Need More Help?
===========
* Fort Turtlebot2 issues and questions: <http://wiki.ros.org/Robots/TurtleBot#Robots.2BAC8-TurtleBot.2BAC8-kinetic.TurtleBot2>
* For ROS related questions: <https://answers.ros.org/questions/>
* Additional resources in the documentation of the mmWave SDK (note hyperlinks will only work if the mmWave SDK has been installed on PC):
* [mmWave SDK Module Doc located at `<mmwave_sdk_install_dir>/docs/mmwave_sdk_module_documentation.html`](file:///C:/ti/mmwave_sdk_03_05_00_04/docs/mmwave_sdk_module_documentation.html)
* [mmWave SDK User's Guide located at `<mmwave_sdk_install_dir>/docs/mmwave_sdk_user_guide.pdf`](file:///C:/ti/mmwave_sdk_03_05_00_04/docs/mmwave_sdk_user_guide.pdf)
* [mmWave SDK Release Notes located at `<mmwave_sdk_install_dir>/docs/mmwave_sdk_release_notes.pdf`](file:///C:/ti/mmwave_sdk_03_05_00_04/docs/mmwave_sdk_release_notes.pdf)
* Find answers to common questions on [mmWave E2E FAQ](https://e2e.ti.com/support/sensors/f/1023/t/595725)
* Search for your issue or post a new question on the [mmWave E2E forum](https://e2e.ti.com/support/sensor/mmwave_sensors/f/1023)
</xmp>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/highlight/styles/zenburn.css"/>
<script src="../../../../.metadata/.html/scripts/strapdown/vendor/jquery-1.11.2.min.js"></script>
<script src="../../../../.metadata/.html/scripts/strapdown/vendor/bootstrap.min.js"></script>
<script src="../../../../.metadata/.html/scripts/highlight/highlight.pack.js"></script>
<script src="../../../../.metadata/.html/scripts/strapdown/v/0.2/strapdown.js"></script>
<script src="../../../../.metadata/.html/scripts/toolbox.js"></script>
<script src="../../../../.metadata/.html/scripts/toolbox_fixes.js"></script>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 459 KiB

View File

Before

Width:  |  Height:  |  Size: 7.4 MiB

After

Width:  |  Height:  |  Size: 7.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

View File

Before

Width:  |  Height:  |  Size: 496 KiB

After

Width:  |  Height:  |  Size: 496 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 KiB

View File

Before

Width:  |  Height:  |  Size: 333 KiB

After

Width:  |  Height:  |  Size: 333 KiB

View File

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8" />
<title>Autonomous Robotics with ROS for mmWave Release Notes - Version 1.6</title>
<title>Autonomous Robotics with ROS for mmWave Release Notes - Version 1.7</title>
</head>
<!-- START PRE -->
@@ -69,8 +69,8 @@ The following are Known Limitations in this release:
* Currently supported/tested for IWR6843ISK
ES2.0 EVM, IWR6843AOP ES2.0 EVM only
* The mmWave EVM must be flashed with:
* The mmWave SDK version 3.4.0.2 out-of-box demo firmware for IWR6843ISK ES2.0
* The mmWave SDK version 3.4.0.2 out-of-box demo firmware for IWR6843AOP ES2.0
* The mmWave SDK version 3.5 out-of-box demo firmware for IWR6843ISK ES2.0
* The mmWave SDK version 3.5 out-of-box demo firmware for IWR6843AOP ES2.0
* The fake_localization ROS navigation package is used to allow direct setting of
the robots initial pose (position/orientation) and goal pose. Therefore, the
gmapping and amcl ROS navigation packages are not used.
@@ -82,7 +82,13 @@ Work Arounds for Major Known Issues
The following are workarounds for each known issue with a major severity that exists in this release:
* N/A
Changes in Version 1.7
========================
The following is a list of changes compared to the previous release.
- Changed cfg files to support SDK 3.5
- Merged source files from safety bubble lab into Autonomous robotics lab
- Added support for quad sensor operation
</xmp>

View File

@@ -0,0 +1,295 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Autonomous Robotics with ROS for mmWave User's Guide - Version 1.7 </title>
</head>
<!-- START PRE -->
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/fonts/ubuntu-regular-woff.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/fonts/glyphicons-halflings-regular.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/themes/united2.min.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/themes/bootstrap-responsive.min.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/strapdown/v/0.2/strapdown.css"/>
<link rel="stylesheet" href="../../../../.metadata/.html/styles/link.css"/>
<!-- END PRE -->
<xmp style="display:none;" class="col-xs-6">
Autonomous Robotics with ROS for mmWave
===========
This lab allows for the TI mmWave sensor to be used with popular mapping and navigation libraries in the Robot Operating System (ROS) environment, familiar to many robotics engineers.
The lab uses the Octomap server and move_base libraries with TIs mmWave ROS Driver Package software to interface to the TI mmWave sensor. The lab supports use of IWR6843ISK or IWR6843AOP ES2.0 EVMs.
With the TI driver and the software from the ROS community (ros.org) engineers may evaluate robot navigation and object avoidance quickly and easily.
This lab could also be used with either one or four sensors. With the use of four sensors, the robot has the ability to have a 360° field of view, thus the robot is able to detect surrounding objects for better mapping and navigation.
<img src="images/intro_senseavoid.gif" class="img-responsive"/>
## Hardware and Software Setup
Before starting this lab, please follow the directions described in the [ROS Setup Guide with TI mmWave](../common/Turtlebot_HWSW_setup.html).
Quickstart
===========
The guide is broken down into three sections: Remote Control Operation, Mapping Demo, and Autonomous Demo. The Remote Control section
explains how to bring up the sensor and drive the turtlebot remotely. The mapping demo uses the point cloud from the sensor to create a map of the
robot's environment. The robot must be manually operated. Finally, the autonomous demo
Remote Control Operation
===========
These steps must take place from the remote machine, “ssh-ing” into the TurtleBot laptop when
necessary.
##TurtleBot Bring-up
To start the TurtleBot, open a terminal window on the remote machine, ssh into the TurtleBot laptop
and run the following command. The `<device>` tag noted below can be one of the following: `6843ISK` or `6843AOP`.
* For setups running a single sensor:
```
$ roslaunch turtlebot_bringup minimal_single_sensor.launch mmwave_device:=<device>
```
* For setups running four sensors:
```
$ roslaunch turtlebot_bringup minimal_quad_sensor.launch mmwave_device:=<device>
```
If the EVM was not in a good state the roslaunch command will fail. Try resetting the EVM by pressing
the NRST button on the EVM and then run the desired roslaunch command again.
After the Turtlebot and mmWave sensor are configured, you may see periodic “Kobuki : malformed subpayload
detected” errors. These errors appear to come from the Turtlebot driver and do not affect the
operation of the demo.
##Teleoperation (Remote Control)
Open a new terminal window on the remote machine and run the following command to bring up the
teleoperation (remote control) of the TurtleBot:
```
$ roslaunch turtlebot_teleop keyboard_teleop.launch
```
Follow the instructions shown in the window to control the TurtleBot. You can exit out of the remote
control application by pressing `CTRL-C`.
Mapping Demo
===========
The Mapping Demo is an example of how to use TIs mmWave Radar EVMs within the ROS framework
on a robot to build a map. This feature is only supported with single sensor setups.
* The demo runs the octomap_server package in ROS. There are several filters that have been brought up
for use: Pass Through filters for all the point cloud fields, and a Statistical Outlier Removal filter for
filtering the raw map.
* **Pass Through Filters**: remove values outside a certain range for a given field (X, Y, Z, intensity)
* **Statistical Outlier Removal**: removes values based off their distance from their closest neighbors
* The parameters/limits for these filters can be found and modified in the
**turtlebot\_mmwave\_launchers/launch/radar\_limit\_filters.launch** file. The **radar_mapping.launch** file
mentioned below must be re-started after changing the **radar_limit_filters.launch** file in order for the
new parameters to take effect.
The processing graph for the incoming point cloud data is shown below:
<img src="images/setup_sw/ros_processing_graph.png" class="img-responsive"/>
##Start-up
To run the mapping demo, first follow the TurtleBot Bring-up and Remote Control instructions in the
“TurtleBot Bring-up and Teleoperation (Remote Control)” section to bring up and remote control the
TurtleBot. Then, to run the mapping demo open a new terminal window, ssh into the TurtleBot laptop
and run the following command:
```
$ roslaunch turtlebot_mmwave_launchers radar_mapping.launch
```
You may see a few warnings immediately after the launch file is run. It may also output a warning saying
“Nothing to publish, octree is empty” whenever there are no objects detected in front of the mmWave
sensor.
##Visualization
To view the TurtleBot, Radar data, and map data in Rviz open a new terminal window on the remote
machine and run the following command which will open a pre-defined Rviz configuration customized
for the mapping demo (the command is all one line):
```
$ rosrun rviz rviz -d ~/catkin_ws/src/turtlebot_mmwave_launchers/launch/mapping_visualization.rviz
```
Alternatively, you can run the following command to open a blank Rviz screen and then manually add
the same topics to the visualization as follows:
```
$ rosrun rviz rviz
```
* Once Rviz has started, add the radar data by selecting Add-> PointCloud2 and selecting /mmWaveDataHdl/RScan under the Topic dropdown menu for the PointCloud2.
* Make the following changes to improve the visualiation:
* Size to 0.03
* Style to Spheres
* Decay to 0.25
* To visualize the TurtleBot on the screen select Add->Robot Model and Rviz will automatically detect the robot
description and display the TurtleBot.
* To view the path the TurtleBot is taking select Add->Path and choose /trajectory under the Topic dropdown for the Path.
* To visualize the octomap output in Rviz, select Add->PointCloud2 and select `<raw_or_filtered>_point_cloud_centers`
* To color points by elevation change ColorTransformer to AxisColor.
* Changing the Size to 0.03 and Style to Spheres will improve the visualization.
You can also save a custom Rviz configuration and load it in the future for convenience.
##Saving a Map
* The TurtleBot laptop is now running the Radar and TurtleBot drivers, as well as all the filtering and
mapping nodes shown in the flow chart above.
* Move the TurtleBot around your environment manually until you are satisfied with your map.
* Then open a new terminal window on the remote machine, ssh into the TurtleBot laptop, and run the following command to save the map:
```
$ rosrun octomap_server octomap_saver f <your_file_name>.bt
```
##Viewing a Previously Saved Map
* To view a saved `<map>.bt` file, you must first shutdown the mapping demo launch file if it was launched
by pressing CTRL-C in the window where the radar_mapping.launch file was launched.
* Rviz will need to be opened and configured as mentioned in the Visualization section above if it is not already open.
* Then, open a new terminal window on the remote machine, ssh into the TurtleBot laptop, and run the following command to serve the saved map (the command is all one line):
```
$ rosrun octomap_server octomap_server_node /path/to/<map>.bt octomap_point_cloud_centers:=filtered_point_cloud_centers
```
You should see the saved map displayed in Rviz. Note that the other topics in Rviz may show a
warning/error since they are not active.
Navigation Demo
===========
The TurtleBot navigation demo runs on the nodes mentioned in the image below.
<img src="images/setup_sw/ros_nodes.png" class="img-responsive"/>
Here are the steps to run the navigation demo:
1. Close all previous terminal windows if any were open
2. Open a new terminal window on the remote machine, ssh into the TurtleBot laptop and bring up the
TurtleBot and mmWave EVM with the following command.The `<device>` tag noted below can be one of the following: `6843ISK` or `6843AOP`.
* For setups running a single sensor:
```
$ roslaunch turtlebot_bringup minimal_single_sensor.launch mmwave_device:=<device>
```
* For setups running four sensors:
```
$ roslaunch turtlebot_bringup minimal_quad_sensor.launch mmwave_device:=<device>
```
If the EVM was not in a good state the roslaunch command will fail. Try resetting the EVM by pressing the NRST button on the EVM and then run the desired roslaunch command again.
The configuration files are included in the ti_mmwave_ros_map_nav_v1p4.tar.gz package ...\ti_mmwave_ros_map_nav_v1p4\ti_mmwave_rospkg\cfg. To change the parameter, edit and save the file using a text editor. For example, to update the demo to run using the IWR6843ISK-ODS and configuration file used with the ODS point cloud demo
- Edit the "6843ISK_3d.cfg" configuration file to one that works with the ODS point cloud demo.
- Flash the IWR6843ISK-ODS with the ODS point cloud binary.
- Run the demo as documented for 6843ISK EVM.
3. To bring up the move_base and fake_localization nodes and load a prebuilt map using the
octomap_server, open a new terminal window on the remote machine, ssh into the TurtleBot
laptop and run the following command:
* For single sensor operation:
```
$ roslaunch turtlebot_mmwave_launchers radar_navigation_single.launch
```
* For quad sensor operation:
```
$ roslaunch turtlebot_mmwave_launchers radar_navigation_quad.launch
```
**Note 1**: By default, this launch file loads a specific prebuilt map file containing a map of a simple
rectangular space roughly 4ft x 6ft which can be used to make the robot stay within a space of that
size for demo and testing purposes.
* To load your own map, edit the radar_navigation.launch file and change the map filename shown in
bold below to your own saved map file.
*node name="octomap_server" pkg="octomap_server" type="octomap_server_node" args**="$(find
turtlebot_mmwave_launchers)/launch/map_4ft_by_6ft_border_large.bt** projected_map:=map" />*
* Alternatively, this static map can be completely disabled/removed as follows if desired to allow the
robot to plan paths freely without any artificial boundaries.
* Remove the line containing “costmap_2d::StaticLayer” in the global_costmap_params.yaml
and local_costmap_params.yaml param files
* Remove the line containing “octomap_server_node” in the ~catkin_ws/src/turtlebot_mmwave_launchers/launch/radar_navigation.launch file
* The size of the global and local costmaps can also be increased in the global_costmap_params.yaml and local_costmap_params.yaml param files to allow setting goals that are farther away
**Note2**: You may see “octree is empty” warnings when there are no objects detected in front of the mmWave sensor.
4. Open a new terminal window on the remote machine and run the following command which will
open a pre-defined Rviz configuration customized for the navigation demo.
* To show the inflation layer which is used for path planning (the command is all one line):
```
$ rosrun rviz rviz -d ~/catkin_ws/src/turtlebot_mmwave_launchers/launch/navigation_visualization.rviz
```
* To not show the inflation layer which is used for path planning (the command is all one line):
```
$ rosrun rviz rviz -d ~/catkin_ws/src/turtlebot_mmwave_launchers/launch/navigation_visualization_2.rviz
```
* Alternatively, you can run the following command to open a blank Rviz screen and then manually add the same topics to the visualization as follows:
```
$ rosrun rviz rviz
```
* “Add” three Map displays, one PointCloud2, the Robot Model, and one PosewithCovariance. Use the
Topic dropdowns on the displays you added in Rviz to select topics for each one.
* For the maps, choose “map” for one and the local and global cost maps for the other two.
* Select /initialpose for PosewithCovariance.
* You can select /mmWaveDataHdl/RScan or /xyzi_filt_out for the PointCloud2.
* Changing the Size to 0.03, Style to Spheres, and Decay to 0.25 will improve the PointCloud2 visualization.
* You can also add two Path topics (one for /move_base/DWAPlannerROS/local_plan and one for /move_base/DWAPlannerROS/global_plan) and a Polygon for /move_base/local_costmap/footprint.
* There is also an alternate pre-defined Rviz configuration file as an additional visualization example
located at “turtlebot_mmwave_launchers/launch/navigation_visualization_2.rviz” that adds a PointCloud for the voxel grid (/move_base/local_costmap/obstacle_layer/marked_cloud) and disables the costmaps.
5. Start the navigation by first providing an initial pose estimate. Select 2D Pose Estimate (along the
top of screen) and click on the location where the TurtleBot is within the map and drag in the
direction it is facing. You should see the TurtleBot appear on the same spot you click immediately
after releasing.
Note: Please do not choose a starting position or goal that is too close to the boundaries of the
current map as the navigation stack will not be able to create what it considers to be a valid path.
6. Now, give the TurtleBot a navigation goal by selecting 2D Nav Goal and clicking the location you
would like the TurtleBot to navigate towards and dragging in the direction you would like it to face.
The TurtleBot should then begin navigation to its goal. If you need to stop it, terminate the
radar_navigation.launch roslaunch command by clicking on the terminal window that was used to
launch it and pressing CTRL-C.
7. As an alternative to manually specifying the initial pose and goal using Rviz, there is also an example
shell script in the “turtlebot_mmwave_launchers/scripts” directory that you can call from the Linux
command prompt to set the initial pose and goal. It is intended to be used with the default 4ft x 6ft
prebuilt map where you start the robot on one of three starting points (a, b, or c) at one end of the
rectangular space facing the opposite end and then send it to one of the three goal points at the
other end. This is useful for demonstrating obstacle avoidance in a 4ft x 6ft space as shown in the
following picture. To run the script, go to the “turtlebot_mmwave_launchers/scripts” directory and
type “./start_nav.sh” at the Linux prompt.
<img src="images/setup_sw/turtlebot_sense_avoid_setup.png" class="img-responsive"/>
Need More Help?
===========
* Fort Turtlebot2 issues and questions: <http://wiki.ros.org/Robots/TurtleBot#Robots.2BAC8-TurtleBot.2BAC8-kinetic.TurtleBot2>
* For ROS related questions: <https://answers.ros.org/questions/>
* Additional resources in the documentation of the mmWave SDK (note hyperlinks will only work if the mmWave SDK has been installed on PC):
* [mmWave SDK Module Doc located at `<mmwave_sdk_install_dir>/docs/mmwave_sdk_module_documentation.html`](file:///C:/ti/mmwave_sdk_03_05_00_04/docs/mmwave_sdk_module_documentation.html)
* [mmWave SDK User's Guide located at `<mmwave_sdk_install_dir>/docs/mmwave_sdk_user_guide.pdf`](file:///C:/ti/mmwave_sdk_03_05_00_04/docs/mmwave_sdk_user_guide.pdf)
* [mmWave SDK Release Notes located at `<mmwave_sdk_install_dir>/docs/mmwave_sdk_release_notes.pdf`](file:///C:/ti/mmwave_sdk_03_05_00_04/docs/mmwave_sdk_release_notes.pdf)
* Find answers to common questions on [mmWave E2E FAQ](https://e2e.ti.com/support/sensors/f/1023/t/595725)
* Search for your issue or post a new question on the [mmWave E2E forum](https://e2e.ti.com/support/sensor/mmwave_sensors/f/1023)
</xmp>
<link rel="stylesheet" href="../../../../.metadata/.html/scripts/highlight/styles/zenburn.css"/>
<script src="../../../../.metadata/.html/scripts/strapdown/vendor/jquery-1.11.2.min.js"></script>
<script src="../../../../.metadata/.html/scripts/strapdown/vendor/bootstrap.min.js"></script>
<script src="../../../../.metadata/.html/scripts/highlight/highlight.pack.js"></script>
<script src="../../../../.metadata/.html/scripts/strapdown/v/0.2/strapdown.js"></script>
<script src="../../../../.metadata/.html/scripts/toolbox.js"></script>
<script src="../../../../.metadata/.html/scripts/toolbox_fixes.js"></script>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

View File

@@ -0,0 +1 @@
/opt/ros/kinetic/share/catkin/cmake/toplevel.cmake

Submodule autonomous_robotics_ros/src/serial added at cbcca7c837

View File

@@ -1,230 +1,232 @@
cmake_minimum_required(VERSION 2.8.3)
project(ti_mmwave_rospkg)
## Add support for C++11, supported in ROS Kinetic and newer
add_definitions(-std=c++11)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
nodelet
roscpp
serial
std_msgs
sensor_msgs
message_generation
pluginlib
)
find_package(Boost REQUIRED )
find_package(Threads REQUIRED)
find_package(PCL 1.7.2 REQUIRED)
## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)
## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()
################################################
## Declare ROS messages, services and actions ##
################################################
## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
## * add a build_depend tag for "message_generation"
## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
## * If MSG_DEP_SET isn't empty the following dependency has been pulled in
## but can be declared for certainty nonetheless:
## * add a run_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
## * add "message_generation" and every package in MSG_DEP_SET to
## find_package(catkin REQUIRED COMPONENTS ...)
## * add "message_runtime" and every package in MSG_DEP_SET to
## catkin_package(CATKIN_DEPENDS ...)
## * uncomment the add_*_files sections below as needed
## and list every .msg/.srv/.action file to be processed
## * uncomment the generate_messages entry below
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
## Generate messages in the 'msg' folder
# add_message_files(
# FILES
# RadarScan.msg
#)
## Generate services in the 'srv' folder
add_service_files(
FILES
mmWaveCLI.srv
)
## Generate actions in the 'action' folder
# add_action_files(
# FILES
# Action1.action
# Action2.action
# )
## Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
std_msgs
sensor_msgs
)
################################################
## Declare ROS dynamic reconfigure parameters ##
################################################
## To declare and build dynamic reconfigure parameters within this
## package, follow these steps:
## * In the file package.xml:
## * add a build_depend and a run_depend tag for "dynamic_reconfigure"
## * In this file (CMakeLists.txt):
## * add "dynamic_reconfigure" to
## find_package(catkin REQUIRED COMPONENTS ...)
## * uncomment the "generate_dynamic_reconfigure_options" section below
## and list every .cfg file to be processed
## Generate dynamic reconfigure parameters in the 'cfg' folder
# generate_dynamic_reconfigure_options(
# cfg/DynReconf1.cfg
# cfg/DynReconf2.cfg
# )
###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
INCLUDE_DIRS include
LIBRARIES mmwave
#CATKIN_DEPENDS nodelet roscpp serial std_msgs
DEPENDS system_lib
)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories( include
${catkin_INCLUDE_DIRS}
${ti_mmwave_rospkg_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${pthread_INCLUDE_DIRS}
${rt_INCLUDE_DIRS}
)
link_directories( ${Boost_LIBRARIES_DIRS} )
link_directories( ${PCL_LIBRARY_DIRS} )
add_definitions(${PCL_DEFINITIONS})
## Declare a C++ library
add_library(mmwave
src/mmWaveDataHdl.cpp
src/mmWaveCommSrv.cpp
src/DataHandlerClass.cpp
)
## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure
add_dependencies(mmwave ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
# add_executable(${PROJECT_NAME}_node src/ti_mmwave_rospkg_node.cpp)
## Rename C++ executable without prefix
## The above recommended prefix causes long target names, the following renames the
## target back to the shorter version for ease of user use
## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")
## Add cmake target dependencies of the executable
## same as for the library above
# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
## Specify libraries to link a library or executable target against
# target_link_libraries(${PROJECT_NAME}_node
# ${catkin_LIBRARIES}
# )
#############
## Install ##
#############
# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# install(PROGRAMS
# scripts/my_python_script
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )
## Mark executables and/or libraries for installation
# install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )
## Mark cpp header files for installation
# install(DIRECTORY include/${PROJECT_NAME}/
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
# FILES_MATCHING PATTERN "*.h"
# PATTERN ".svn" EXCLUDE
# )
## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
# # myfile1
# # myfile2
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )
set (CMAKE_CXX_STANDARD 11)
add_executable(${PROJECT_NAME} src/mmWaveLoader.cpp)
target_link_libraries(mmwave ${serial_LIBRARIES})
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} mmwave ${serial_LIBRARIES})
add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS} mmwave ${serial_EXPORTED_TARGETS})
add_executable(mmWaveQuickConfig src/mmWaveQuickConfig.cpp)
target_link_libraries(mmWaveQuickConfig ${catkin_LIBRARIES} mmwave)
add_dependencies(mmWaveQuickConfig ${catkin_EXPORTED_TARGETS} mmwave)
#############
## Testing ##
#############
## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_ti_mmwave_rospkg.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()
## Add folders to be run by python nosetests
# catkin_add_nosetests(test)
cmake_minimum_required(VERSION 2.8.3)
project(ti_mmwave_rospkg)
## Add support for C++11, supported in ROS Kinetic and newer
add_definitions(-std=c++11)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
nodelet
roscpp
serial
std_msgs
sensor_msgs
message_generation
pluginlib
)
find_package(Boost REQUIRED)
find_package(Threads REQUIRED)
find_package(PCL 1.7.2 REQUIRED)
## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)
## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()
################################################
## Declare ROS messages, services and actions ##
################################################
## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
## * add a build_depend tag for "message_generation"
## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
## * If MSG_DEP_SET isn't empty the following dependency has been pulled in
## but can be declared for certainty nonetheless:
## * add a run_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
## * add "message_generation" and every package in MSG_DEP_SET to
## find_package(catkin REQUIRED COMPONENTS ...)
## * add "message_runtime" and every package in MSG_DEP_SET to
## catkin_package(CATKIN_DEPENDS ...)
## * uncomment the add_*_files sections below as needed
## and list every .msg/.srv/.action file to be processed
## * uncomment the generate_messages entry below
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
## Generate messages in the 'msg' folder
add_message_files(
FILES
RadarScan.msg
)
## Generate services in the 'srv' folder
add_service_files(
FILES
mmWaveCLI.srv
)
## Generate actions in the 'action' folder
# add_action_files(
# FILES
# Action1.action
# Action2.action
# )
## Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
std_msgs
sensor_msgs
)
################################################
## Declare ROS dynamic reconfigure parameters ##
################################################
## To declare and build dynamic reconfigure parameters within this
## package, follow these steps:
## * In the file package.xml:
## * add a build_depend and a run_depend tag for "dynamic_reconfigure"
## * In this file (CMakeLists.txt):
## * add "dynamic_reconfigure" to
## find_package(catkin REQUIRED COMPONENTS ...)
## * uncomment the "generate_dynamic_reconfigure_options" section below
## and list every .cfg file to be processed
## Generate dynamic reconfigure parameters in the 'cfg' folder
# generate_dynamic_reconfigure_options(
# cfg/DynReconf1.cfg
# cfg/DynReconf2.cfg
# )
###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
INCLUDE_DIRS include
LIBRARIES mmwave
#CATKIN_DEPENDS nodelet roscpp serial std_msgs
DEPENDS system_lib
)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories( include
${catkin_INCLUDE_DIRS}
${ti_mmwave_rospkg_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${pthread_INCLUDE_DIRS}
${rt_INCLUDE_DIRS}
)
link_directories( ${Boost_LIBRARIES_DIRS} )
link_directories( ${PCL_LIBRARY_DIRS} )
add_definitions(${PCL_DEFINITIONS})
## Declare a C++ library
add_library(mmwave
src/mmWaveDataHdl.cpp
src/mmWaveCommSrv.cpp
src/DataHandlerClass.cpp
src/mmWaveQuickConfig.cpp
src/ParameterParser.cpp
)
## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure
add_dependencies(mmwave ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
# add_executable(${PROJECT_NAME}_node src/ti_mmwave_rospkg_node.cpp)
## Rename C++ executable without prefix
## The above recommended prefix causes long target names, the following renames the
## target back to the shorter version for ease of user use
## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")
## Add cmake target dependencies of the executable
## same as for the library above
# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
## Specify libraries to link a library or executable target against
# target_link_libraries(${PROJECT_NAME}_node
# ${catkin_LIBRARIES}
# )
#############
## Install ##
#############
# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# install(PROGRAMS
# scripts/my_python_script
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )
## Mark executables and/or libraries for installation
# install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )
## Mark cpp header files for installation
# install(DIRECTORY include/${PROJECT_NAME}/
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
# FILES_MATCHING PATTERN "*.h"
# PATTERN ".svn" EXCLUDE
# )
## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
# # myfile1
# # myfile2
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )
set (CMAKE_CXX_STANDARD 11)
add_executable(${PROJECT_NAME} src/mmWaveLoader.cpp)
target_link_libraries(mmwave ${serial_LIBRARIES})
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} mmwave ${serial_LIBRARIES})
add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS} mmwave ${serial_EXPORTED_TARGETS})
add_executable(mmWaveQuickConfig src/mmWaveQuickConfig.cpp)
target_link_libraries(mmWaveQuickConfig ${catkin_LIBRARIES} mmwave)
add_dependencies(mmWaveQuickConfig ${catkin_EXPORTED_TARGETS} mmwave)
#############
## Testing ##
#############
## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_ti_mmwave_rospkg.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()
## Add folders to be run by python nosetests
# catkin_add_nosetests(test)

View File

@@ -0,0 +1,183 @@
# TI mmWave ROS Package (Customized)
#### Auhor and Maintainer: Leo Zhang
#### Organization: University of Arizona
#### Email: dr.leo.zhang@outlook.com
---
### Most recent change:
Add support for XWR18XX devices. SDK version: 3.2.0.4.
---
Initially derived from TI's origin ROS package in Industrial Toolbox 2.3.0 (new version available [Industrial Toolbox 2.5.2](http://dev.ti.com/tirex/#/?link=Software%2FmmWave%20Sensors%2FIndustrial%20Toolbox)).
### Differences from origin TI's version:
1. Added all radar parameters from calculations and can be read from `rosparam get`.
2. Added Doppler data from detecting targets and form a customized ROS message `/ti_mmwave/radar_scan`.
3. Added support for multiple radars working together.
4. Added support for camera overlay (for sensor fusion).
5. Working with xWR1443 and xWR1642 ES1.0 and ES2.0 (ES1.0 is deprecated from TI)
---
### Available devices:
```
TI mmWave AWR1443BOOST
TI mmWave AWR1642BOOST
TI mmWave AWR1642BOOST ES2.0/3.0 EVM (not tested)
TI mmWave AWR1642BOOST ES2.0 EVM
TI mmWave AWR1843BOOST ES1.0 EVM
```
---
### Quick start guide (AWR1642BOOST ES2.0 EVM):
1. Mount AWR1642BOOST ES2.0 EVM (as below), connect 5V/2.5A power supply and connect a micro-USB cable to host Ubuntu 16.04 LTS with [ROS Kinetic](http://wiki.ros.org/kinetic).
![](https://github.com/radar-lab/ti_mmwave_rospkg/raw/master/auxiliary/mounting.jpg "AWR1642 Mounting")
Note: Tested with Ubuntu 16.04 LTS with ROS Kinectic and Ubuntu 18.04 LTS with [ROS Melodic](http://wiki.ros.org/melodic)
2. Download SDK 2.0 or above (suggested SDK 2.1) from [here](http://www.ti.com/tool/MMWAVE-SDK) and use [UNIFLASH](http://www.ti.com/tool/UNIFLASH) to flash xwr16xx_mmw_demo.bin to your device. **Do not forget SOP2 jumper when flashing.**
Note:
AWR1642 ES1.0 (usually purchased before May 2018) uses SDK 1.2. AWR1642 ES2.0 (usually purchased after May 2018) uses SDK 2.0. Same applies to AWR1443. (You can refer to [this thread](https://e2e.ti.com/support/sensors/f/1023/t/692195?tisearch=e2e-sitesearch&keymatch=%20user:356347))
3. Clone this repo and ROS serial onto your `<workspace dir>/src`:
```
git clone https://github.com/radar-lab/ti_mmwave_rospkg.git
git clone https://github.com/wjwwood/serial.git
```
4. Go back to `<workspace dir>`:
```
catkin_make && source devel/setup.bash
echo "source <workspace_dir>/devel/setup.bash" >> ~/.bashrc
```
5. Enable command and data ports on Linux:
```
sudo chmod 666 /dev/ttyACM0
sudo chmod 666 /dev/ttyACM1
```
Note: If multiple sensors are used, enable additional ports `/dev/ttyACM2` and `/dev/ttyACM3`, etc. the same as this step.
6. Launch AWR1642 short range config:
```
roslaunch ti_mmwave_rospkg 1642es2_short_range.launch
```
Note: If you want to build your own config, use [mmWave Demo Visualizer](https://dev.ti.com/mmwavedemovisualizer) and link the launch file to the config.
7. ROS topics can be accessed as follows:
```
rostopic list
rostopic echo /ti_mmwave/radar_scan
```
8. ROS parameters can be accessed as follows:
```
rosparam list
rosparam get /ti_mmwave/max_doppler_vel
```
Note: AWR1843 requires SDK 3.2.0.4, which has different output format. The later release will improve this part.
---
### Message format:
```
header:
seq: 6264
stamp:
secs: 1538888235
nsecs: 712113897
frame_id: "ti_mmwave" # Frame ID used for multi-sensor scenarios
point_id: 17 # Point ID of the detecting frame (Every frame starts with 0)
x: 8.650390625 # Point x coordinates in m (front from antenna)
y: 6.92578125 # Point y coordinates in m (left/right from antenna, right positive)
z: 0.0 # Point z coordinates in m (up/down from antenna, up positive)
range: 11.067276001 # Radar measured range in m
velocity: 0.0 # Radar measured range rate in m/s
doppler_bin: 8 # Doppler bin location of the point (total bins = num of chirps)
bearing: 38.6818885803 # Radar measured angle in degrees (right positive)
intensity: 13.6172780991 # Radar measured intensity in dB
```
---
### Troubleshooting
1.
```
mmWaveCommSrv: Failed to open User serial port with error: IO Exception (13): Permission denied
mmWaveCommSrv: Waiting 20 seconds before trying again...
```
This happens when serial port is called without superuser permission, do the following steps:
```
sudo chmod 666 /dev/ttyACM0
sudo chmod 666 /dev/ttyACM1
```
2.
```
mmWaveQuickConfig: Command failed (mmWave sensor did not respond with 'Done')
mmWaveQuickConfig: Response: 'sensorStop
'?`????`????`???~' is not recognized as a CLI command
mmwDemo:/>'
```
When this happens, re-run the command you send to sensor. If it continues, shut down and restart the sensor.
---
### Multiple devices support (dual AWR1642 ES2.0 EVM):
1. Connect two devices and try `ll /dev/serial/by-id` or `ls /dev`. In this case, `/dev/ttyACM0` to `/dev/ttyACM3` should shown.
2. To avoid serial port confliction, you need to launch devices separately. So for first device (it will open rviz):
```
roslaunch ti_mmwave_rospkg multi_1642_0.launch
```
3. Change radars' location in first three arguments `<node pkg="tf" type="static_transform_publisher" name="radar_baselink_0" args="0 -1 0 0 0 0 ti_mmwave_pcl ti_mmwave_0 100"/>` (stands for x,y,z for positions) in launch file `multi_1642_1.launch`. And launch second device:
```
roslaunch ti_mmwave_rospkg multi_1642_1.launch
```
Note: As serial connection and the original code, you need to launch devices separately using different launch files.
---
### Camera overlay support (working with USB camera or CV camera):
1. Download and build USB camera repo [here](https://github.com/radar-lab/usb_webcam`). And set parameters of camera in `<usb_webcam dir>/launch/usb_webcam.launch`.
2. To test the device image working, try:
```
roslaunch usb_webcam usb_webcam.launch
rosrun rqt_image_view rqt_image_view
```
3. Make sure you have done [ROS camera calibration](http://wiki.ros.org/camera_calibration) and create a `*.yaml` configuration file accordingly.
4. Launch radar-camera system using:
```
roslaunch ti_mmwave_rospkg camera_overlay.launch
```
---
### Changelog:
```
v3.3.0
Add support for XWR18XX devices. SDK version: 3.2.0.4.
v3.2.2
Fix bugs and update README.
v3.2.1
Support camera overlay over 3D 1443s.
v3.2.0
Added camera overlay support.
v3.1.0
Strengthened code.
v3.0.0
Added README.
Improved rviz looking for point cloud data.
Added support for multiple radars working together.
Improved radar's all around working conditions.
v2.0.0
Added support for ES2.0 EVM devices.
v1.0.0
Added Doppler from TI's mmWave radars.
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -1,39 +1,40 @@
% ***************************************************************
% Created for SDK ver:01.02
% Created using Visualizer ver:1.2.0.0
% Frequency:77
% Platform:xWR14xx
% Scene Classifier:best_range_res
% Azimuth Resolution(deg):15
% Range Resolution(m):0.044
% Maximum unambiguous Range(m):9.01
% Maximum Radial Velocity(m/s):5.06
% Radial velocity resolution(m/s):0.64
% Frame Duration(msec):33.333
% Range Detection Threshold (dB):9
% Range Peak Grouping:disabled
% Doppler Peak Grouping:enabled
% Static clutter removal:disabled
% ***************************************************************
sensorStop
flushCfg
dfeDataOutputMode 1
channelCfg 15 5 0
adcCfg 2 1
adcbufCfg 0 1 0 1
profileCfg 0 77 39 7 57.14 0 0 70 1 240 4884 0 0 30
chirpCfg 0 0 0 0 0 0 0 1
chirpCfg 1 1 0 0 0 0 0 4
frameCfg 0 1 16 0 33.333 1 0
guiMonitor 1 0 0 0 0 0
cfarCfg 0 2 8 4 3 0 768
peakGrouping 1 0 1 1 229
multiObjBeamForming 1 0.5
clutterRemoval 0
calibDcRangeSig 0 -5 8 256
compRangeBiasAndRxChanPhase 0.0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
measureRangeBiasAndRxChanPhase 0 1.5 0.2
CQRxSatMonitor 0 3 5 123 0
CQSigImgMonitor 0 119 4
analogMonitor 1 1
sensorStart
% ***************************************************************
% Created for SDK ver:01.02
% Created using Visualizer ver:1.2.0.0
% Frequency:77
% Platform:xWR14xx
% Scene Classifier:best_range_res
% Azimuth Resolution(deg):15
% Range Resolution(m):0.044
% Maximum unambiguous Range(m):9.01
% Maximum Radial Velocity(m/s):5.06
% Radial velocity resolution(m/s):0.64
% Frame Duration(msec):33.333
% Range Detection Threshold (dB):9
% Range Peak Grouping:disabled
% Doppler Peak Grouping:enabled
% Static clutter removal:disabled
% ***************************************************************
sensorStop
flushCfg
dfeDataOutputMode 1
channelCfg 15 5 0
adcCfg 2 1
adcbufCfg 0 1 0 1
profileCfg 0 77 39 7 57.14 0 0 70 1 240 4884 0 0 30
chirpCfg 0 0 0 0 0 0 0 1
chirpCfg 1 1 0 0 0 0 0 4
frameCfg 0 1 16 0 33.333 1 0
guiMonitor 1 0 0 0 0 0
cfarCfg 0 2 8 4 3 0 768
peakGrouping 1 0 1 1 229
multiObjBeamForming 1 0.5
clutterRemoval 0
calibDcRangeSig 0 -5 8 256
compRangeBiasAndRxChanPhase 0.0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
measureRangeBiasAndRxChanPhase 0 1.5 0.2
CQRxSatMonitor 0 3 5 123 0
CQSigImgMonitor 0 119 4
analogMonitor 1 1
calibData 0 0 0
sensorStart

View File

@@ -1,40 +1,41 @@
% ***************************************************************
% Created for SDK ver:01.02
% Created using Visualizer ver:1.2.0.0
% Frequency:77
% Platform:xWR14xx
% Scene Classifier:best_range_res
% Azimuth Resolution(deg):15 + Elevation
% Range Resolution(m):0.044
% Maximum unambiguous Range(m):9.01
% Maximum Radial Velocity(m/s):5.06
% Radial velocity resolution(m/s):0.64
% Frame Duration(msec):33.333
% Range Detection Threshold (dB):9
% Range Peak Grouping:disabled
% Doppler Peak Grouping:enabled
% Static clutter removal:disabled
% ***************************************************************
sensorStop
flushCfg
dfeDataOutputMode 1
channelCfg 15 7 0
adcCfg 2 1
adcbufCfg 0 1 0 1
profileCfg 0 77 7 7 57.14 0 0 70 1 240 4884 0 0 30
chirpCfg 0 0 0 0 0 0 0 1
chirpCfg 1 1 0 0 0 0 0 4
chirpCfg 2 2 0 0 0 0 0 2
frameCfg 0 2 16 0 33.333 1 0
guiMonitor 1 0 0 0 0 0
cfarCfg 0 2 8 4 3 0 768
peakGrouping 1 0 1 1 229
multiObjBeamForming 1 0.5
clutterRemoval 0
calibDcRangeSig 0 -5 8 256
compRangeBiasAndRxChanPhase 0.0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
measureRangeBiasAndRxChanPhase 0 1.5 0.2
CQRxSatMonitor 0 3 5 123 0
CQSigImgMonitor 0 119 4
analogMonitor 1 1
sensorStart
% ***************************************************************
% Created for SDK ver:01.02
% Created using Visualizer ver:1.2.0.0
% Frequency:77
% Platform:xWR14xx
% Scene Classifier:best_range_res
% Azimuth Resolution(deg):15 + Elevation
% Range Resolution(m):0.044
% Maximum unambiguous Range(m):9.01
% Maximum Radial Velocity(m/s):5.06
% Radial velocity resolution(m/s):0.64
% Frame Duration(msec):33.333
% Range Detection Threshold (dB):9
% Range Peak Grouping:disabled
% Doppler Peak Grouping:enabled
% Static clutter removal:disabled
% ***************************************************************
sensorStop
flushCfg
dfeDataOutputMode 1
channelCfg 15 7 0
adcCfg 2 1
adcbufCfg 0 1 0 1
profileCfg 0 77 7 7 57.14 0 0 70 1 240 4884 0 0 30
chirpCfg 0 0 0 0 0 0 0 1
chirpCfg 1 1 0 0 0 0 0 4
chirpCfg 2 2 0 0 0 0 0 2
frameCfg 0 2 16 0 33.333 1 0
guiMonitor 1 0 0 0 0 0
cfarCfg 0 2 8 4 3 0 768
peakGrouping 1 0 1 1 229
multiObjBeamForming 1 0.5
clutterRemoval 0
calibDcRangeSig 0 -5 8 256
compRangeBiasAndRxChanPhase 0.0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
measureRangeBiasAndRxChanPhase 0 1.5 0.2
CQRxSatMonitor 0 3 5 123 0
CQSigImgMonitor 0 119 4
analogMonitor 1 1
calibData 0 0 0
sensorStart

View File

@@ -0,0 +1,51 @@
% ***************************************************************
% Created for SDK ver:03.03
% Created using Visualizer ver:3.3.0.0
% Frequency:77
% Platform:xWR16xx
% Scene Classifier:best_range_res
% Azimuth Resolution(deg):15
% Range Resolution(m):0.044
% Maximum unambiguous Range(m):9.02
% Maximum Radial Velocity(m/s):1
% Radial velocity resolution(m/s):0.13
% Frame Duration(msec):100
% Range Detection Threshold (dB):15
% Doppler Detection Threshold (dB):15
% Range Peak Grouping:enabled
% Doppler Peak Grouping:enabled
% Static clutter removal:disabled
% Angle of Arrival FoV: Full FoV
% Range FoV: Full FoV
% Doppler FoV: Full FoV
% ***************************************************************
sensorStop
flushCfg
dfeDataOutputMode 1
channelCfg 15 3 0
adcCfg 2 1
adcbufCfg -1 0 1 1 0
profileCfg 0 77 429 7 57.14 0 0 70 1 256 5209 0 0 30
chirpCfg 0 0 0 0 0 0 0 1
chirpCfg 1 1 0 0 0 0 0 2
frameCfg 0 1 16 0 100 1 0
lowPower 0 1
guiMonitor -1 1 1 0 0 0 1
cfarCfg -1 0 2 8 4 3 0 15 1
cfarCfg -1 1 0 4 2 3 1 15 1
multiObjBeamForming -1 1 0.5
clutterRemoval -1 0
calibDcRangeSig -1 0 -5 8 256
extendedMaxVelocity -1 0
bpmCfg -1 0 0 1
lvdsStreamCfg -1 0 0 0
compRangeBiasAndRxChanPhase 0.0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
measureRangeBiasAndRxChanPhase 0 1.5 0.2
CQRxSatMonitor 0 3 5 121 0
CQSigImgMonitor 0 127 4
analogMonitor 0 0
aoaFovCfg -1 -90 90 -90 90
cfarFovCfg -1 0 0 8.92
cfarFovCfg -1 1 -1 1.00
calibData 0 0 0
sensorStart

View File

@@ -0,0 +1,50 @@
% ***************************************************************
% Created for SDK ver:03.03
% Created using Visualizer ver:3.3.0.0
% Frequency:77
% Platform:xWR18xx
% Scene Classifier:best_range_res
% Azimuth Resolution(deg):15
% Range Resolution(m):0.044
% Maximum unambiguous Range(m):9.02
% Maximum Radial Velocity(m/s):6.45
% Radial velocity resolution(m/s):0.81
% Frame Duration(msec):100
% Range Detection Threshold (dB):15
% Doppler Detection Threshold (dB):15
% Range Peak Grouping:enabled
% Doppler Peak Grouping:enabled
% Static clutter removal:disabled
% Angle of Arrival FoV: Full FoV
% Range FoV: Full FoV
% Doppler FoV: Full FoV
% ***************************************************************
sensorStop
flushCfg
dfeDataOutputMode 1
channelCfg 15 5 0
adcCfg 2 1
adcbufCfg -1 0 1 1 1
profileCfg 0 77 18 7 57.14 0 0 70 1 256 5209 0 0 30
chirpCfg 0 0 0 0 0 0 0 1
chirpCfg 1 1 0 0 0 0 0 4
frameCfg 0 1 16 0 100 1 0
lowPower 0 0
guiMonitor -1 1 1 0 0 0 1
cfarCfg -1 0 2 8 4 3 0 15 1
cfarCfg -1 1 0 4 2 3 1 15 1
multiObjBeamForming -1 1 0.5
clutterRemoval -1 0
calibDcRangeSig -1 0 -5 8 256
extendedMaxVelocity -1 0
lvdsStreamCfg -1 0 0 0
compRangeBiasAndRxChanPhase 0.0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
measureRangeBiasAndRxChanPhase 0 1.5 0.2
CQRxSatMonitor 0 3 5 121 0
CQSigImgMonitor 0 127 4
analogMonitor 0 0
aoaFovCfg -1 -90 90 -90 90
cfarFovCfg -1 0 0 8.92
cfarFovCfg -1 1 -6.48 6.48
calibData 0 0 0
sensorStart

View File

@@ -1,50 +1,51 @@
% ***************************************************************
% Created for SDK ver:03.02
% Created using Visualizer ver:3.2.0.1
% Frequency:77
% Platform:xWR18xx
% Scene Classifier:best_range_res
% Azimuth Resolution(deg):15 + Elevation
% Range Resolution(m):0.044
% Maximum unambiguous Range(m):9.02
% Maximum Radial Velocity(m/s):1
% Radial velocity resolution(m/s):0.13
% Frame Duration(msec):100
% Range Detection Threshold (dB):15
% Doppler Detection Threshold (dB):15
% Range Peak Grouping:enabled
% Doppler Peak Grouping:enabled
% Static clutter removal:disabled
% Angle of Arrival FoV: Full FoV
% Range FoV: Full FoV
% Doppler FoV: Full FoV
% ***************************************************************
sensorStop
flushCfg
dfeDataOutputMode 1
channelCfg 15 7 0
adcCfg 2 1
adcbufCfg -1 0 1 1 1
profileCfg 0 77 267 7 57.14 0 0 70 1 256 5209 0 0 30
chirpCfg 0 0 0 0 0 0 0 1
chirpCfg 1 1 0 0 0 0 0 4
chirpCfg 2 2 0 0 0 0 0 2
frameCfg 0 2 16 0 100 1 0
lowPower 0 0
guiMonitor -1 1 1 0 0 0 1
cfarCfg -1 0 2 8 4 3 0 15 0
cfarCfg -1 1 0 4 2 3 1 15 1
multiObjBeamForming -1 1 0.5
clutterRemoval -1 0
calibDcRangeSig -1 0 -5 8 256
extendedMaxVelocity -1 0
lvdsStreamCfg -1 0 0 0
compRangeBiasAndRxChanPhase 0.0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
measureRangeBiasAndRxChanPhase 0 1.5 0.2
CQRxSatMonitor 0 3 5 121 0
CQSigImgMonitor 0 127 4
analogMonitor 0 0
aoaFovCfg -1 -90 90 -90 90
cfarFovCfg -1 0 0 8.92
cfarFovCfg -1 1 -1 1.00
sensorStart
% ***************************************************************
% Created for SDK ver:03.03
% Created using Visualizer ver:3.3.0.0
% Frequency:77
% Platform:xWR18xx
% Scene Classifier:best_range_res
% Azimuth Resolution(deg):15 + Elevation
% Range Resolution(m):0.044
% Maximum unambiguous Range(m):9.02
% Maximum Radial Velocity(m/s):1
% Radial velocity resolution(m/s):0.13
% Frame Duration(msec):100
% Range Detection Threshold (dB):15
% Doppler Detection Threshold (dB):15
% Range Peak Grouping:enabled
% Doppler Peak Grouping:enabled
% Static clutter removal:disabled
% Angle of Arrival FoV: Full FoV
% Range FoV: Full FoV
% Doppler FoV: Full FoV
% ***************************************************************
sensorStop
flushCfg
dfeDataOutputMode 1
channelCfg 15 7 0
adcCfg 2 1
adcbufCfg -1 0 1 1 1
profileCfg 0 77 267 7 57.14 0 0 70 1 256 5209 0 0 30
chirpCfg 0 0 0 0 0 0 0 1
chirpCfg 1 1 0 0 0 0 0 4
chirpCfg 2 2 0 0 0 0 0 2
frameCfg 0 2 16 0 100 1 0
lowPower 0 0
guiMonitor -1 1 1 0 0 0 1
cfarCfg -1 0 2 8 4 3 0 15 1
cfarCfg -1 1 0 4 2 3 1 15 1
multiObjBeamForming -1 1 0.5
clutterRemoval -1 0
calibDcRangeSig -1 0 -5 8 256
extendedMaxVelocity -1 0
lvdsStreamCfg -1 0 0 0
compRangeBiasAndRxChanPhase 0.0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
measureRangeBiasAndRxChanPhase 0 1.5 0.2
CQRxSatMonitor 0 3 5 121 0
CQSigImgMonitor 0 127 4
analogMonitor 0 0
aoaFovCfg -1 -90 90 -90 90
cfarFovCfg -1 0 0 8.92
cfarFovCfg -1 1 -1 1.00
calibData 0 0 0
sensorStart

View File

@@ -46,5 +46,6 @@ analogMonitor 0 0
aoaFovCfg -1 -90 90 -90 90
cfarFovCfg -1 0 0 8.92
cfarFovCfg -1 1 -1 1.00
calibData 0 0 0
sensorStart

View File

@@ -47,4 +47,5 @@ analogMonitor 0 0
aoaFovCfg -1 -90 90 -90 90
cfarFovCfg -1 0 0 8.40
cfarFovCfg -1 1 -5.02 5.02
calibData 0 0 0
sensorStart

View File

@@ -1,51 +1,53 @@
% ***************************************************************
% Created for SDK ver:03.02
% Created using Visualizer ver:3.2.0.1
% Frequency:60
% Platform:xWR68xx
% Scene Classifier:best_range_res
% Azimuth Resolution(deg):15 + Elevation
% Range Resolution(m):0.047
% Maximum unambiguous Range(m):9.04
% Maximum Radial Velocity(m/s):5.09
% Radial velocity resolution(m/s):0.64
% Frame Duration(msec):33.333
% Range Detection Threshold (dB):15
% Doppler Detection Threshold (dB):15
% Range Peak Grouping:enabled
% Doppler Peak Grouping:enabled
% Static clutter removal:disabled
% Angle of Arrival FoV: Full FoV
% Range FoV: Full FoV
% Doppler FoV: Full FoV
% ***************************************************************
sensorStop
flushCfg
dfeDataOutputMode 1
channelCfg 15 7 0
adcCfg 2 1
adcbufCfg -1 0 1 1 1
profileCfg 0 60 41 7 40 0 0 100 1 240 7500 0 0 30
chirpCfg 0 0 0 0 0 0 0 1
chirpCfg 1 1 0 0 0 0 0 4
chirpCfg 2 2 0 0 0 0 0 2
frameCfg 0 2 16 0 33.333 1 0
lowPower 0 0
guiMonitor -1 1 0 0 0 0 0
cfarCfg -1 0 2 8 4 3 0 15 0
cfarCfg -1 1 0 4 2 3 1 15 1
multiObjBeamForming -1 1 0.5
clutterRemoval -1 0
calibDcRangeSig -1 0 -5 8 256
extendedMaxVelocity -1 0
bpmCfg -1 0 0 1
lvdsStreamCfg -1 0 0 0
compRangeBiasAndRxChanPhase 0.0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
measureRangeBiasAndRxChanPhase 0 1.5 0.2
CQRxSatMonitor 0 3 4 99 0
CQSigImgMonitor 0 119 4
analogMonitor 0 0
aoaFovCfg -1 -90 90 -90 90
cfarFovCfg -1 0 0 9.00
cfarFovCfg -1 1 -5.14 5.14
sensorStart
% ***************************************************************
% Created for SDK ver:03.02
% Created using Visualizer ver:3.2.0.1
% Frequency:60
% Platform:xWR68xx
% Scene Classifier:best_range_res
% Azimuth Resolution(deg):15 + Elevation
% Range Resolution(m):0.047
% Maximum unambiguous Range(m):9.04
% Maximum Radial Velocity(m/s):5.09
% Radial velocity resolution(m/s):0.64
% Frame Duration(msec):33.333
% Range Detection Threshold (dB):15
% Doppler Detection Threshold (dB):15
% Range Peak Grouping:enabled
% Doppler Peak Grouping:enabled
% Static clutter removal:disabled
% Angle of Arrival FoV: Full FoV
% Range FoV: Full FoV
% Doppler FoV: Full FoV
% ***************************************************************
sensorStop
flushCfg
dfeDataOutputMode 1
channelCfg 15 7 0
adcCfg 2 1
adcbufCfg -1 0 1 1 1
profileCfg 0 60 41 7 40 0 0 100 1 240 7500 0 0 30
chirpCfg 0 0 0 0 0 0 0 1
chirpCfg 1 1 0 0 0 0 0 4
chirpCfg 2 2 0 0 0 0 0 2
frameCfg 0 2 16 0 33.333 1 0
lowPower 0 0
guiMonitor -1 1 0 0 0 0 0
cfarCfg -1 0 2 8 4 3 0 15 0
cfarCfg -1 1 0 4 2 3 1 15 1
multiObjBeamForming -1 1 0.5
clutterRemoval -1 1
calibDcRangeSig -1 0 -5 8 256
extendedMaxVelocity -1 0
bpmCfg -1 0 0 1
lvdsStreamCfg -1 1 1 1
compRangeBiasAndRxChanPhase 0.0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
measureRangeBiasAndRxChanPhase 0 1.5 0.2
CQRxSatMonitor 0 3 4 99 0
CQSigImgMonitor 0 119 4
analogMonitor 0 0
aoaFovCfg -1 -90 90 -90 90
cfarFovCfg -1 0 0 9.00
cfarFovCfg -1 1 -5.14 5.14
calibData 0 0 0
sensorStart

View File

@@ -0,0 +1,51 @@
% ***************************************************************
% Created for SDK ver:03.03
% Created using Visualizer ver:3.3.0.0
% Frequency:60
% Platform:xWR68xx
% Scene Classifier:best_range_res
% Azimuth Resolution(deg):15
% Range Resolution(m):0.044
% Maximum unambiguous Range(m):9.02
% Maximum Radial Velocity(m/s):1
% Radial velocity resolution(m/s):0.13
% Frame Duration(msec):100
% Range Detection Threshold (dB):15
% Doppler Detection Threshold (dB):15
% Range Peak Grouping:enabled
% Doppler Peak Grouping:enabled
% Static clutter removal:disabled
% Angle of Arrival FoV: Full FoV
% Range FoV: Full FoV
% Doppler FoV: Full FoV
% ***************************************************************
sensorStop
flushCfg
dfeDataOutputMode 1
channelCfg 15 5 0
adcCfg 2 1
adcbufCfg -1 0 1 1 1
profileCfg 0 60 567 7 57.14 0 0 70 1 256 5209 0 0 30
chirpCfg 0 0 0 0 0 0 0 1
chirpCfg 1 1 0 0 0 0 0 4
frameCfg 0 1 16 0 100 1 0
lowPower 0 0
guiMonitor -1 1 1 0 0 0 1
cfarCfg -1 0 2 8 4 3 0 15 1
cfarCfg -1 1 0 4 2 3 1 15 1
multiObjBeamForming -1 1 0.5
clutterRemoval -1 0
calibDcRangeSig -1 0 -5 8 256
extendedMaxVelocity -1 0
bpmCfg -1 0 0 1
lvdsStreamCfg -1 0 0 0
compRangeBiasAndRxChanPhase 0.0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
measureRangeBiasAndRxChanPhase 0 1.5 0.2
CQRxSatMonitor 0 3 5 121 0
CQSigImgMonitor 0 127 4
analogMonitor 0 0
aoaFovCfg -1 -90 90 -90 90
cfarFovCfg -1 0 0 8.92
cfarFovCfg -1 1 -1 1.00
calibData 0 0 0
sensorStart

View File

@@ -0,0 +1,52 @@
% ***************************************************************
% Created for SDK ver:03.02
% Created using Visualizer ver:3.2.0.1
% Frequency:60
% Platform:xWR68xx
% Scene Classifier:best_range_res
% Azimuth Resolution(deg):15 + Elevation
% Range Resolution(m):0.047
% Maximum unambiguous Range(m):9.04
% Maximum Radial Velocity(m/s):5.09
% Radial velocity resolution(m/s):0.64
% Frame Duration(msec):33.333
% Range Detection Threshold (dB):15
% Doppler Detection Threshold (dB):15
% Range Peak Grouping:enabled
% Doppler Peak Grouping:enabled
% Static clutter removal:disabled
% Angle of Arrival FoV: Full FoV
% Range FoV: Full FoV
% Doppler FoV: Full FoV
% ***************************************************************
sensorStop
flushCfg
dfeDataOutputMode 1
channelCfg 15 7 0
adcCfg 2 1
adcbufCfg -1 0 1 1 1
profileCfg 0 60 41 7 40 0 0 100 1 240 7500 0 0 30
chirpCfg 0 0 0 0 0 0 0 1
chirpCfg 1 1 0 0 0 0 0 4
chirpCfg 2 2 0 0 0 0 0 2
frameCfg 0 2 16 0 33.333 1 0
lowPower 0 0
guiMonitor -1 1 1 0 0 0 1
cfarCfg -1 0 2 8 4 3 0 15 1
cfarCfg -1 1 0 4 2 3 1 15 1
multiObjBeamForming -1 1 0.5
clutterRemoval -1 1
calibDcRangeSig -1 0 -5 8 256
extendedMaxVelocity -1 0
bpmCfg -1 0 0 1
lvdsStreamCfg -1 0 0 0
compRangeBiasAndRxChanPhase 0.0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
measureRangeBiasAndRxChanPhase 0 1.5 0.2
CQRxSatMonitor 0 3 4 99 0
CQSigImgMonitor 0 119 4
analogMonitor 0 0
aoaFovCfg -1 -90 90 -90 90
cfarFovCfg -1 0 0 9.00
cfarFovCfg -1 1 -5.14 5.14
calibData 0 0 0
sensorStart

View File

@@ -1,152 +1,142 @@
/*
* DataHandlerClass.cpp
*
* This file defines the DataUARTHandler class.
*
*
* Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef _DATA_HANDLER_CLASS_
#define _DATA_HANDLER_CLASS_
#include "mmWave.h"
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <boost/shared_ptr.hpp>
#include "ros/ros.h"
#include "sensor_msgs/PointCloud2.h"
#define COUNT_SYNC_MAX 2
class DataUARTHandler{
public:
/*Constructor*/
//void DataUARTHandler(ros::NodeHandle* nh) : currentBufp(&pingPongBuffers[0]) , nextBufp(&pingPongBuffers[1]) {}
DataUARTHandler(ros::NodeHandle* nh);
/*User callable function to set the UARTPort*/
void setUARTPort(char* mySerialPort);
/*User callable function to set the BaudRate*/
void setBaudRate(int myBaudRate);
/*User callable function to set maxAllowedElevationAngleDeg*/
void setMaxAllowedElevationAngleDeg(int myMaxAllowedElevationAngleDeg);
/*User callable function to set maxAllowedElevationAngleDeg*/
void setMaxAllowedAzimuthAngleDeg(int myMaxAllowedAzimuthAngleDeg);
void setNodeHandle(ros::NodeHandle* nh);
/*User callable function to start the handler's internal threads*/
void start(void);
/*Helper functions to allow pthread compatability*/
static void* readIncomingData_helper(void *context);
static void* sortIncomingData_helper(void *context);
static void* syncedBufferSwap_helper(void *context);
/*Sorted mmwDemo Data structure*/
mmwDataPacket mmwData;
private:
/*Contains the name of the serial port*/
char* dataSerialPort;
/*Contains the baud Rate*/
int dataBaudRate;
/*Contains the max_allowed_elevation_angle_deg (points with elevation angles
outside +/- max_allowed_elevation_angle_deg will be removed)*/
int maxAllowedElevationAngleDeg;
/*Contains the max_allowed_azimuth_angle_deg (points with azimuth angles
outside +/- max_allowed_azimuth_angle_deg will be removed)*/
int maxAllowedAzimuthAngleDeg;
/*Mutex protected variable which synchronizes threads*/
int countSync;
/*Read/Write Buffers*/
std::vector<uint8_t> pingPongBuffers[2];
/*Pointer to current data (sort)*/
std::vector<uint8_t>* currentBufp;
/*Pointer to new data (read)*/
std::vector<uint8_t>* nextBufp;
/*Mutex protecting the countSync variable */
pthread_mutex_t countSync_mutex;
/*Mutex protecting the nextBufp pointer*/
pthread_mutex_t nextBufp_mutex;
/*Mutex protecting the currentBufp pointer*/
pthread_mutex_t currentBufp_mutex;
/*Condition variable which blocks the Swap Thread until signaled*/
pthread_cond_t countSync_max_cv;
/*Condition variable which blocks the Read Thread until signaled*/
pthread_cond_t read_go_cv;
/*Condition variable which blocks the Sort Thread until signaled*/
pthread_cond_t sort_go_cv;
/*Swap Buffer Pointers Thread*/
void *syncedBufferSwap(void);
/*Checks if the magic word was found*/
int isMagicWord(uint8_t last8Bytes[8]);
/*Read incoming UART Data Thread*/
void *readIncomingData(void);
/*Sort incoming UART Data Thread*/
void *sortIncomingData(void);
ros::NodeHandle* nodeHandle;
ros::Publisher DataUARTHandler_pub;
};
#endif
#ifndef _DATA_HANDLER_CLASS_
#define _DATA_HANDLER_CLASS_
#include <ti_mmwave_rospkg/RadarScan.h>
#include "mmWave.h"
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <boost/shared_ptr.hpp>
#include "ros/ros.h"
#include "sensor_msgs/PointCloud2.h"
#include <pthread.h>
#include <algorithm>
#include "pcl_ros/point_cloud.h"
#include "sensor_msgs/PointField.h"
#include "sensor_msgs/PointCloud2.h"
#include "sensor_msgs/point_cloud2_iterator.h"
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <visualization_msgs/Marker.h>
#include <cmath>
#define COUNT_SYNC_MAX 2
class DataUARTHandler{
public:
/*Constructor*/
//void DataUARTHandler(ros::NodeHandle* nh) : currentBufp(&pingPongBuffers[0]) , nextBufp(&pingPongBuffers[1]) {}
DataUARTHandler(ros::NodeHandle* nh);
void setFrameID(char* myFrameID);
/*User callable function to set the UARTPort*/
void setUARTPort(char* mySerialPort);
/*User callable function to set the BaudRate*/
void setBaudRate(int myBaudRate);
/*User callable function to set maxAllowedElevationAngleDeg*/
void setMaxAllowedElevationAngleDeg(int myMaxAllowedElevationAngleDeg);
/*User callable function to set maxAllowedElevationAngleDeg*/
void setMaxAllowedAzimuthAngleDeg(int myMaxAllowedAzimuthAngleDeg);
void setNodeHandle(ros::NodeHandle* nh);
/*User callable function to start the handler's internal threads*/
void start(void);
/*Helper functions to allow pthread compatability*/
static void* readIncomingData_helper(void *context);
static void* sortIncomingData_helper(void *context);
static void* syncedBufferSwap_helper(void *context);
/*Sorted mmwDemo Data structure*/
mmwDataPacket mmwData;
private:
int nr;
int nd;
int ntx;
float fs;
float fc;
float BW;
float PRI;
float tfr;
float max_range;
float vrange;
float max_vel;
float vvel;
char* frameID;
/*Contains the name of the serial port*/
char* dataSerialPort;
/*Contains the baud Rate*/
int dataBaudRate;
/*Contains the max_allowed_elevation_angle_deg (points with elevation angles
outside +/- max_allowed_elevation_angle_deg will be removed)*/
int maxAllowedElevationAngleDeg;
/*Contains the max_allowed_azimuth_angle_deg (points with azimuth angles
outside +/- max_allowed_azimuth_angle_deg will be removed)*/
int maxAllowedAzimuthAngleDeg;
/*Mutex protected variable which synchronizes threads*/
int countSync;
/*Read/Write Buffers*/
std::vector<uint8_t> pingPongBuffers[2];
/*Pointer to current data (sort)*/
std::vector<uint8_t>* currentBufp;
/*Pointer to new data (read)*/
std::vector<uint8_t>* nextBufp;
/*Mutex protecting the countSync variable */
pthread_mutex_t countSync_mutex;
/*Mutex protecting the nextBufp pointer*/
pthread_mutex_t nextBufp_mutex;
/*Mutex protecting the currentBufp pointer*/
pthread_mutex_t currentBufp_mutex;
/*Condition variable which blocks the Swap Thread until signaled*/
pthread_cond_t countSync_max_cv;
/*Condition variable which blocks the Read Thread until signaled*/
pthread_cond_t read_go_cv;
/*Condition variable which blocks the Sort Thread until signaled*/
pthread_cond_t sort_go_cv;
/*Swap Buffer Pointers Thread*/
void *syncedBufferSwap(void);
/*Checks if the magic word was found*/
int isMagicWord(uint8_t last8Bytes[8]);
/*Read incoming UART Data Thread*/
void *readIncomingData(void);
/*Sort incoming UART Data Thread*/
void *sortIncomingData(void);
void visualize(const ti_mmwave_rospkg::RadarScan &msg);
ros::NodeHandle* nodeHandle;
ros::Publisher DataUARTHandler_pub;
ros::Publisher radar_scan_pub;
ros::Publisher marker_pub;
};
#endif

View File

@@ -0,0 +1,35 @@
#ifndef _PARAM_PARSER_CLASS_
#define _PARAM_PARSER_CLASS_
#include "ros/ros.h"
#include "std_msgs/String.h"
#include "ti_mmwave_rospkg/mmWaveCLI.h"
#include <nodelet/nodelet.h>
#include <pluginlib/class_list_macros.h>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <cstdio>
#include <sstream>
#include <string>
#include <vector>
namespace ti_mmwave_rospkg {
class ParameterParser : public nodelet::Nodelet{
public:
ParameterParser();
void ParamsParser(ti_mmwave_rospkg::mmWaveCLI &srv, ros::NodeHandle &n);
void CalParams(ros::NodeHandle &nh);
private:
virtual void onInit();
ti_mmwave_rospkg::mmWaveCLI srv;
};
}
#endif

View File

@@ -1,194 +1,190 @@
/*
* mmWave.h
*
* This file contains various defines used within this package.
*
*
* Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef _TI_IWR14XX_
#define _TI_IWR14XX_
#include <iostream>
#include <iostream>
#include <cstdio>
#include "serial/serial.h"
#include "ros/ros.h"
#include <boost/thread.hpp>
#include <cstdint>
enum MmwDemo_Output_TLV_Types
{
MMWDEMO_OUTPUT_MSG_NULL = 0,
/*! @brief List of detected points */
MMWDEMO_OUTPUT_MSG_DETECTED_POINTS,
/*! @brief Range profile */
MMWDEMO_OUTPUT_MSG_RANGE_PROFILE,
/*! @brief Noise floor profile */
MMWDEMO_OUTPUT_MSG_NOISE_PROFILE,
/*! @brief Samples to calculate static azimuth heatmap */
MMWDEMO_OUTPUT_MSG_AZIMUTH_STATIC_HEAT_MAP,
/*! @brief Range/Doppler detection matrix */
MMWDEMO_OUTPUT_MSG_RANGE_DOPPLER_HEAT_MAP,
/*! @brief Stats information */
MMWDEMO_OUTPUT_MSG_STATS,
/*! @brief List of detected points side information */
MMWDEMO_OUTPUT_MSG_DETECTED_POINTS_SIDE_INFO,
MMWDEMO_OUTPUT_MSG_MAX
};
enum SorterState{ READ_HEADER,
CHECK_TLV_TYPE,
READ_OBJ_STRUCT,
READ_LOG_MAG_RANGE,
READ_NOISE,
READ_AZIMUTH,
READ_DOPPLER,
READ_STATS,
SWAP_BUFFERS,
READ_SIDE_INFO};
struct MmwDemo_output_message_header_t
{
/*! brief Version: : MajorNum * 2^24 + MinorNum * 2^16 + BugfixNum * 2^8 + BuildNum */
uint32_t version;
/*! @brief Total packet length including header in Bytes */
uint32_t totalPacketLen;
/*! @brief platform type */
uint32_t platform;
/*! @brief Frame number */
uint32_t frameNumber;
/*! @brief Time in CPU cycles when the message was created. For XWR16xx: DSP CPU cycles, for XWR14xx: R4F CPU cycles */
uint32_t timeCpuCycles;
/*! @brief Number of detected objects */
uint32_t numDetectedObj;
/*! @brief Number of TLVs */
uint32_t numTLVs;
/*! @brief Sub-frame Number (not used with XWR14xx) */
uint32_t subFrameNumber;
};
// Detected object structure for mmWave SDK 1.x and 2.x
struct MmwDemo_DetectedObj
{
uint16_t rangeIdx; /*!< @brief Range index */
uint16_t dopplerIdx; /*!< @brief Dopler index */
uint16_t peakVal; /*!< @brief Peak value */
int16_t x; /*!< @brief x - coordinate in meters. Q format depends on the range resolution */
int16_t y; /*!< @brief y - coordinate in meters. Q format depends on the range resolution */
int16_t z; /*!< @brief z - coordinate in meters. Q format depends on the range resolution */
};
// Detected object structures for mmWave SDK 3.x (DPIF_PointCloudCartesian_t and DPIF_PointCloudSideInfo_t)
/**
* @brief
* Point cloud definition in Cartesian coordinate system - floating point format
*
*/
typedef struct DPIF_PointCloudCartesian_t
{
/*! @brief x - coordinate in meters */
float x;
/*! @brief y - coordinate in meters */
float y;
/*! @brief z - coordinate in meters */
float z;
/*! @brief Doppler velocity estimate in m/s. Positive velocity means target
* is moving away from the sensor and negative velocity means target
* is moving towards the sensor. */
float velocity;
}DPIF_PointCloudCartesian;
/**
* @brief
* Point cloud side information such as SNR and noise level
*
*/
typedef struct DPIF_PointCloudSideInfo_t
{
/*! @brief snr - CFAR cell to side noise ratio in dB expressed in 0.1 steps of dB */
int16_t snr;
/*! @brief y - CFAR noise level of the side of the detected cell in dB expressed in 0.1 steps of dB */
int16_t noise;
}DPIF_PointCloudSideInfo;
struct mmwDataPacket{
MmwDemo_output_message_header_t header;
uint16_t numObjOut;
uint16_t xyzQFormat; // only used for SDK 1.x and 2.x
MmwDemo_DetectedObj objOut; // only used for SDK 1.x and 2.x
DPIF_PointCloudCartesian_t newObjOut; // used for SDK 3.x
DPIF_PointCloudSideInfo_t sideInfo; // used for SDK 3.x
};
const uint8_t magicWord[8] = {2, 1, 4, 3, 6, 5, 8, 7};
#endif
/*
* mmWave.h
*
* This file contains various defines used within this package.
*
*
* Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef _TI_IWR14XX_
#define _TI_IWR14XX_
#include <iostream>
#include <iostream>
#include <cstdio>
#include "serial/serial.h"
#include "ros/ros.h"
#include <boost/thread.hpp>
#include <cstdint>
enum MmwDemo_Output_TLV_Types
{
MMWDEMO_OUTPUT_MSG_NULL = 0,
/*! @brief List of detected points */
MMWDEMO_OUTPUT_MSG_DETECTED_POINTS,
/*! @brief Range profile */
MMWDEMO_OUTPUT_MSG_RANGE_PROFILE,
/*! @brief Noise floor profile */
MMWDEMO_OUTPUT_MSG_NOISE_PROFILE,
/*! @brief Samples to calculate static azimuth heatmap */
MMWDEMO_OUTPUT_MSG_AZIMUTH_STATIC_HEAT_MAP,
/*! @brief Range/Doppler detection matrix */
MMWDEMO_OUTPUT_MSG_RANGE_DOPPLER_HEAT_MAP,
/*! @brief Stats information */
MMWDEMO_OUTPUT_MSG_STATS,
/*! @brief List of detected points side information */
MMWDEMO_OUTPUT_MSG_DETECTED_POINTS_SIDE_INFO,
MMWDEMO_OUTPUT_MSG_MAX
};
enum SorterState{ READ_HEADER,
CHECK_TLV_TYPE,
READ_OBJ_STRUCT,
READ_LOG_MAG_RANGE,
READ_NOISE,
READ_AZIMUTH,
READ_DOPPLER,
READ_STATS,
SWAP_BUFFERS,
READ_SIDE_INFO};
struct MmwDemo_output_message_header_t
{
/*! brief Version: : MajorNum * 2^24 + MinorNum * 2^16 + BugfixNum * 2^8 + BuildNum */
uint32_t version;
/*! @brief Total packet length including header in Bytes */
uint32_t totalPacketLen;
/*! @brief platform type */
uint32_t platform;
/*! @brief Frame number */
uint32_t frameNumber;
/*! @brief Time in CPU cycles when the message was created. For XWR16xx: DSP CPU cycles, for XWR14xx: R4F CPU cycles */
uint32_t timeCpuCycles;
/*! @brief Number of detected objects */
uint32_t numDetectedObj;
/*! @brief Number of TLVs */
uint32_t numTLVs;
/*! @brief Sub-frame Number (not used with XWR14xx) */
uint32_t subFrameNumber;
};
// Detected object structure for mmWave SDK 1.x and 2.x
struct MmwDemo_DetectedObj
{
uint16_t rangeIdx; /*!< @brief Range index */
uint16_t dopplerIdx; /*!< @brief Dopler index */
uint16_t peakVal; /*!< @brief Peak value */
int16_t x; /*!< @brief x - coordinate in meters. Q format depends on the range resolution */
int16_t y; /*!< @brief y - coordinate in meters. Q format depends on the range resolution */
int16_t z; /*!< @brief z - coordinate in meters. Q format depends on the range resolution */
};
// Detected object structures for mmWave SDK 3.x (DPIF_PointCloudCartesian_t and DPIF_PointCloudSideInfo_t)
/**
* @brief
* Point cloud definition in Cartesian coordinate system - floating point format
*
*/
typedef struct DPIF_PointCloudCartesian_t
{
/*! @brief x - coordinate in meters */
float x;
/*! @brief y - coordinate in meters */
float y;
/*! @brief z - coordinate in meters */
float z;
/*! @brief Doppler velocity estimate in m/s. Positive velocity means target
* is moving away from the sensor and negative velocity means target
* is moving towards the sensor. */
float velocity;
}DPIF_PointCloudCartesian;
/**
* @brief
* Point cloud side information such as SNR and noise level
*
*/
typedef struct DPIF_PointCloudSideInfo_t
{
/*! @brief snr - CFAR cell to side noise ratio in dB expressed in 0.1 steps of dB */
int16_t snr;
/*! @brief y - CFAR noise level of the side of the detected cell in dB expressed in 0.1 steps of dB */
int16_t noise;
}DPIF_PointCloudSideInfo;
struct mmwDataPacket{
MmwDemo_output_message_header_t header;
uint16_t numObjOut;
uint16_t xyzQFormat; // only used for SDK 1.x and 2.x
MmwDemo_DetectedObj objOut; // only used for SDK 1.x and 2.x
DPIF_PointCloudCartesian_t newObjOut; // used for SDK 3.x
DPIF_PointCloudSideInfo_t sideInfo; // used for SDK 3.x
};
const uint8_t magicWord[8] = {2, 1, 4, 3, 6, 5, 8, 7};
#endif

View File

@@ -1,83 +1,83 @@
/*
* mmWaveCommSrv.hpp
*
* This file defines a ROS nodelet which will open up a serial port provided by the user
* at a certain baud rate (also provided by user) that will interface with the 1443EVM mmwDemo
* User UART to be used for board configuration.
*
*
* Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef MMWAVE_COMM_SRV_H
#define MMWAVE_COMM_SRV_H
/*Include ROS specific headers*/
#include "ros/ros.h"
#include "std_msgs/String.h"
#include "serial/serial.h"
#include <pluginlib/class_list_macros.h>
#include <nodelet/nodelet.h>
/*Include standard C/C++ headers*/
#include <iostream>
#include <cstdio>
#include <sstream>
/*mmWave Driver Headers*/
#include <ti_mmwave_rospkg/mmWaveCLI.h>
namespace ti_mmwave_rospkg
{
class mmWaveCommSrv : public nodelet::Nodelet
{
public:
mmWaveCommSrv();
private:
virtual void onInit();
bool commSrv_cb(ti_mmwave_rospkg::mmWaveCLI::Request &req, ti_mmwave_rospkg::mmWaveCLI::Response &res);
ros::ServiceServer commSrv;
std::string mySerialPort;
int myBaudRate;
}; //Class mmWaveCommSrv
} //namespace ti_mmwave_rospkg
#endif
/*
* mmWaveCommSrv.hpp
*
* This file defines a ROS nodelet which will open up a serial port provided by the user
* at a certain baud rate (also provided by user) that will interface with the 1443EVM mmwDemo
* User UART to be used for board configuration.
*
*
* Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef MMWAVE_COMM_SRV_H
#define MMWAVE_COMM_SRV_H
/*Include ROS specific headers*/
#include "ros/ros.h"
#include "std_msgs/String.h"
#include "serial/serial.h"
#include <pluginlib/class_list_macros.h>
#include <nodelet/nodelet.h>
/*Include standard C/C++ headers*/
#include <iostream>
#include <cstdio>
#include <sstream>
/*mmWave Driver Headers*/
#include <ti_mmwave_rospkg/mmWaveCLI.h>
namespace ti_mmwave_rospkg
{
class mmWaveCommSrv : public nodelet::Nodelet
{
public:
mmWaveCommSrv();
private:
virtual void onInit();
bool commSrv_cb(ti_mmwave_rospkg::mmWaveCLI::Request &req, ti_mmwave_rospkg::mmWaveCLI::Response &res);
ros::ServiceServer commSrv;
std::string mySerialPort;
int myBaudRate;
}; //Class mmWaveCommSrv
} //namespace ti_mmwave_rospkg
#endif

View File

@@ -1,80 +1,80 @@
/*
* mmWaveDataHdl.hpp
*
* This file defines a ROS nodelet which will open up a serial port provided by the user
* at a certain baud rate (also provided by user) that will interface with the 1443EVM mmwDemo
* Data UART to be used for board configuration.
*
*
* Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef MMWAVE_DATA_HDL_H
#define MMWAVE_DATA_HDL_H
/*Include ROS specific headers*/
#include "ros/ros.h"
#include "std_msgs/String.h"
#include "serial/serial.h"
#include <pluginlib/class_list_macros.h>
#include <nodelet/nodelet.h>
/*Include standard C/C++ headers*/
#include <iostream>
#include <cstdio>
#include <sstream>
/*mmWave Driver Headers*/
#include "DataHandlerClass.h"
namespace ti_mmwave_rospkg
{
class mmWaveDataHdl : public nodelet::Nodelet
{
public:
mmWaveDataHdl();
private:
virtual void onInit();
//char* mySerialPort;
//int myBaudRate;
}; //Class mmWaveDataHdl
} //namespace ti_mmwave_rospkg
#endif
/*
* mmWaveDataHdl.hpp
*
* This file defines a ROS nodelet which will open up a serial port provided by the user
* at a certain baud rate (also provided by user) that will interface with the 1443EVM mmwDemo
* Data UART to be used for board configuration.
*
*
* Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef MMWAVE_DATA_HDL_H
#define MMWAVE_DATA_HDL_H
/*Include ROS specific headers*/
#include "ros/ros.h"
#include "std_msgs/String.h"
#include "serial/serial.h"
#include <pluginlib/class_list_macros.h>
#include <nodelet/nodelet.h>
/*Include standard C/C++ headers*/
#include <iostream>
#include <cstdio>
#include <sstream>
/*mmWave Driver Headers*/
#include "DataHandlerClass.h"
namespace ti_mmwave_rospkg
{
class mmWaveDataHdl : public nodelet::Nodelet
{
public:
mmWaveDataHdl();
private:
virtual void onInit();
//char* mySerialPort;
//int myBaudRate;
}; //Class mmWaveDataHdl
} //namespace ti_mmwave_rospkg
#endif

View File

@@ -0,0 +1,9 @@
<launch>
<!-- Call mmWave sensor launch file -->
<include file="$(find ti_mmwave_rospkg)/launch/bubble_sensor_north.launch"> </include>
<include file="$(find ti_mmwave_rospkg)/launch/bubble_sensor_east.launch"> </include>
<include file="$(find ti_mmwave_rospkg)/launch/bubble_sensor_south.launch"> </include>
<include file="$(find ti_mmwave_rospkg)/launch/bubble_sensor_west.launch"> </include>
</launch>

View File

@@ -0,0 +1,30 @@
<!--
This file will launch rViz along with the mmWave sensor node and configure a TI mmWave 1642 sensor using a 2D config
-->
<launch>
<!-- Input arguments -->
<arg name="device" doc="TI mmWave sensor device type [1443, 1642]"/>
<arg name="config" doc="TI mmWave sensor device configuration [3d_best_range_res (not supported by 1642 EVM), 2d_best_range_res]"/>
<arg name="max_allowed_elevation_angle_deg" default="90" doc="Maximum allowed elevation angle in degrees for detected object data [0 > value >= 90]}"/>
<arg name="max_allowed_azimuth_angle_deg" default="90" doc="Maximum allowed azimuth angle in degrees for detected object data [0 > value >= 90]}"/>
<!-- mmWave_Manager node -->
<node pkg="ti_mmwave_rospkg" type="ti_mmwave_rospkg" name="ti_mmwave" ns="radar_1" output="screen">
<param name="command_port" value="/dev/mmWave_00D83B95_00" />
<param name="command_rate" value="115200" />
<param name="data_port" value="/dev/mmWave_00D83B95_01" />
<param name="data_rate" value="921600" />
<param name="max_allowed_elevation_angle_deg" value="$(arg max_allowed_elevation_angle_deg)" />
<param name="max_allowed_azimuth_angle_deg" value="$(arg max_allowed_azimuth_angle_deg)" />
<param name="frame_id" value="/ti_mmwave_1"/>
<remap from="/ti_mmwave/radar_scan_pcl" to="/ti_mmwave/radar_scan_pcl_1"/>
</node>
<!-- mmWaveQuickConfig node (terminates after configuring mmWave sensor) -->
<node pkg="ti_mmwave_rospkg" type="mmWaveQuickConfig" name="ti_mmwave_config" ns="radar_1" args="$(find ti_mmwave_rospkg)/cfg/$(arg device)_$(arg config).cfg" output="screen" />
<node pkg="tf" type="static_transform_publisher" name="radar_baselink_1" args="0 -0.19 0.18 1.57 3.1415 0 base_link ti_mmwave_1 100"/>
</launch>

View File

@@ -0,0 +1,32 @@
<!--
This file will launch rViz along with the mmWave sensor node and configure a TI mmWave 1642 sensor using a 2D config
-->
<launch>
<!-- Input arguments -->
<arg name="device" doc="TI mmWave sensor device type [1443, 1642]"/>
<arg name="config" doc="TI mmWave sensor device configuration [3d_best_range_res (not supported by 1642 EVM), 2d_best_range_res]"/>
<arg name="max_allowed_elevation_angle_deg" default="90" doc="Maximum allowed elevation angle in degrees for detected object data [0 > value >= 90]}"/>
<arg name="max_allowed_azimuth_angle_deg" default="90" doc="Maximum allowed azimuth angle in degrees for detected object data [0 > value >= 90]}"/>
<!-- mmWave_Manager node -->
<node pkg="ti_mmwave_rospkg" type="ti_mmwave_rospkg" name="ti_mmwave" ns="radar_0" output="screen">
<param name="command_port" value="/dev/mmWave_00CE0FCA_00" />
<param name="command_rate" value="115200" />
<param name="data_port" value="/dev/mmWave_00CE0FCA_01" />
<param name="data_rate" value="921600" />
<param name="max_allowed_elevation_angle_deg" value="$(arg max_allowed_elevation_angle_deg)" />
<param name="max_allowed_azimuth_angle_deg" value="$(arg max_allowed_azimuth_angle_deg)" />
<param name="frame_id" value="/ti_mmwave_0"/>
<remap from="/ti_mmwave/radar_scan_pcl" to="/ti_mmwave/radar_scan_pcl_0"/>
</node>
<!-- mmWaveQuickConfig node (terminates after configuring mmWave sensor) -->
<node pkg="ti_mmwave_rospkg" type="mmWaveQuickConfig" name="ti_mmwave_config" ns="radar_0" args="$(find ti_mmwave_rospkg)/cfg/$(arg device)_$(arg config).cfg" output="screen" />
<node pkg="tf" type="static_transform_publisher" name="radar_baselink_0" args="0.19 0 0.18 0 0 3.1415 base_link ti_mmwave_0 100"/>
<!--
<node pkg="rviz" type="rviz" name="rviz" args="-d $(find ti_mmwave_rospkg)/launch/rviz/ti_mmwave_multi.rviz"/>
-->
</launch>

View File

@@ -0,0 +1,30 @@
<!--
This file will launch rViz along with the mmWave sensor node and configure a TI mmWave 1642 sensor using a 2D config
-->
<launch>
<!-- Input arguments -->
<arg name="device" doc="TI mmWave sensor device type [1443, 1642]"/>
<arg name="config" doc="TI mmWave sensor device configuration [3d_best_range_res (not supported by 1642 EVM), 2d_best_range_res]"/>
<arg name="max_allowed_elevation_angle_deg" default="90" doc="Maximum allowed elevation angle in degrees for detected object data [0 > value >= 90]}"/>
<arg name="max_allowed_azimuth_angle_deg" default="90" doc="Maximum allowed azimuth angle in degrees for detected object data [0 > value >= 90]}"/>
<!-- mmWave_Manager node -->
<node pkg="ti_mmwave_rospkg" type="ti_mmwave_rospkg" name="ti_mmwave" ns="radar_2" output="screen">
<param name="command_port" value="/dev/mmWave_00CE0E81_00" />
<param name="command_rate" value="115200" />
<param name="data_port" value="/dev/mmWave_00CE0E81_01" />
<param name="data_rate" value="921600" />
<param name="max_allowed_elevation_angle_deg" value="$(arg max_allowed_elevation_angle_deg)" />
<param name="max_allowed_azimuth_angle_deg" value="$(arg max_allowed_azimuth_angle_deg)" />
<param name="frame_id" value="/ti_mmwave_2"/>
<remap from="/ti_mmwave/radar_scan_pcl" to="/ti_mmwave/radar_scan_pcl_2"/>
</node>
<!-- mmWaveQuickConfig node (terminates after configuring mmWave sensor) -->
<node pkg="ti_mmwave_rospkg" type="mmWaveQuickConfig" name="ti_mmwave_config" ns="radar_2" args="$(find ti_mmwave_rospkg)/cfg/$(arg device)_$(arg config).cfg" output="screen" />
<node pkg="tf" type="static_transform_publisher" name="radar_baselink_2" args="-.19 0 0.18 3.14 0 3.14 base_link ti_mmwave_2 100"/>
</launch>

View File

@@ -0,0 +1,30 @@
<!--
This file will launch rViz along with the mmWave sensor node and configure a TI mmWave 1642 sensor using a 2D config
-->
<launch>
<!-- Input arguments -->
<arg name="device" doc="TI mmWave sensor device type [1443, 1642]"/>
<arg name="config" doc="TI mmWave sensor device configuration [3d_best_range_res (not supported by 1642 EVM), 2d_best_range_res]"/>
<arg name="max_allowed_elevation_angle_deg" default="90" doc="Maximum allowed elevation angle in degrees for detected object data [0 > value >= 90]}"/>
<arg name="max_allowed_azimuth_angle_deg" default="90" doc="Maximum allowed azimuth angle in degrees for detected object data [0 > value >= 90]}"/>
<!-- mmWave_Manager node -->
<node pkg="ti_mmwave_rospkg" type="ti_mmwave_rospkg" name="ti_mmwave" ns="radar_3" output="screen">
<param name="command_port" value="/dev/mmWave_00CE0FCD_00" />
<param name="command_rate" value="115200" />
<param name="data_port" value="/dev/mmWave_00CE0FCD_01" />
<param name="data_rate" value="921600" />
<param name="max_allowed_elevation_angle_deg" value="$(arg max_allowed_elevation_angle_deg)" />
<param name="max_allowed_azimuth_angle_deg" value="$(arg max_allowed_azimuth_angle_deg)" />
<param name="frame_id" value="/ti_mmwave_3"/>
<remap from="/ti_mmwave/radar_scan_pcl" to="/ti_mmwave/radar_scan_pcl_3"/>
</node>
<!-- mmWaveQuickConfig node (terminates after configuring mmWave sensor) -->
<node pkg="ti_mmwave_rospkg" type="mmWaveQuickConfig" name="ti_mmwave_config" ns="radar_3" args="$(find ti_mmwave_rospkg)/cfg/$(arg device)_$(arg config).cfg" output="screen" />
<node pkg="tf" type="static_transform_publisher" name="radar_baselink_3" args="0 0.19 0.18 -1.57 3.1415 0 base_link ti_mmwave_3 100"/>
</launch>

View File

@@ -12,15 +12,19 @@
<!-- mmWave_Manager node -->
<node pkg="ti_mmwave_rospkg" type="ti_mmwave_rospkg" name="mmWave_Manager" output="screen">
<param name="command_port" value="/dev/ttyACM0" />
<param name="command_port" value="/dev/mmWave_00CE0FCA_00" />
<param name="command_rate" value="115200" />
<param name="data_port" value="/dev/ttyACM1" />
<param name="data_port" value="/dev/mmWave_00CE0FCA_01" />
<param name="data_rate" value="921600" />
<param name="max_allowed_elevation_angle_deg" value="$(arg max_allowed_elevation_angle_deg)" />
<param name="max_allowed_azimuth_angle_deg" value="$(arg max_allowed_azimuth_angle_deg)" />
<param name="frame_id" value="/ti_mmwave"/>
<remap from="/ti_mmwave/radar_scan_pcl" to="/ti_mmwave/radar_scan_pcl"/>
</node>
<!-- mmWaveQuickConfig node (terminates after configuring mmWave sensor) -->
<node pkg="ti_mmwave_rospkg" type="mmWaveQuickConfig" name="mmWaveQuickConfig" args="$(find ti_mmwave_rospkg)/cfg/$(arg device)_$(arg config).cfg" output="screen" />
<node pkg="tf" type="static_transform_publisher" name="radar_baselink_0" args="0.19 0 0.18 0 0 3.1415 base_link ti_mmwave 100"/>
</launch>

View File

@@ -1,16 +1,16 @@
<library path="lib/libmmwave">
<class name="ti_mmwave_rospkg/mmWaveCommSrv" type="ti_mmwave_rospkg::mmWaveCommSrv" base_class_type="nodelet::Nodelet">
<description>
Command Service Nodelet
</description>
</class>
<class name="ti_mmwave_rospkg/mmWaveDataHdl" type="ti_mmwave_rospkg::mmWaveDataHdl" base_class_type="nodelet::Nodelet">
<description>
Data Handler Nodelet
</description>
</class>
<depend>serial</depend>
</library>
<library path="lib/libmmwave">
<class name="ti_mmwave_rospkg/mmWaveCommSrv" type="ti_mmwave_rospkg::mmWaveCommSrv" base_class_type="nodelet::Nodelet">
<description>
Command Service Nodelet
</description>
</class>
<class name="ti_mmwave_rospkg/mmWaveDataHdl" type="ti_mmwave_rospkg::mmWaveDataHdl" base_class_type="nodelet::Nodelet">
<description>
Data Handler Nodelet
</description>
</class>
<depend>serial</depend>
</library>

View File

@@ -0,0 +1,10 @@
Header header
uint16 point_id
float32 x
float32 y
float32 z
float32 range
float32 velocity
uint16 doppler_bin
float32 bearing
float32 intensity

View File

@@ -1,59 +1,59 @@
<?xml version="1.0"?>
<package>
<name>ti_mmwave_rospkg</name>
<version>1.5.0</version>
<description>The ti_mmwave_rospkg package</description>
<!-- One maintainer tag required, multiple allowed, one person per tag -->
<!-- Example: -->
<!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
<maintainer email="maintainer@example.com">maintainer</maintainer>
<!-- One license tag required, multiple allowed, one license per tag -->
<!-- Commonly used license strings: -->
<!-- BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
<license>BSD</license>
<!-- Url tags are optional, but multiple are allowed, one per tag -->
<!-- Optional attribute type can be: website, bugtracker, or repository -->
<!-- Example: -->
<!-- <url type="website">http://wiki.ros.org/ti_mmwave_rospkg</url> -->
<!-- Author tags are optional, multiple are allowed, one per tag -->
<!-- Authors do not have to be maintainers, but could be -->
<!-- Example: -->
<!-- <author email="jane.doe@example.com">Jane Doe</author> -->
<!-- The *_depend tags are used to specify dependencies -->
<!-- Dependencies can be catkin packages or system dependencies -->
<!-- Examples: -->
<!-- Use build_depend for packages you need at compile time: -->
<!-- <build_depend>message_generation</build_depend> -->
<!-- Use buildtool_depend for build tool packages: -->
<!-- <buildtool_depend>catkin</buildtool_depend> -->
<!-- Use run_depend for packages you need at runtime: -->
<!-- <run_depend>message_runtime</run_depend> -->
<!-- Use test_depend for packages you need only for testing: -->
<!-- <test_depend>gtest</test_depend> -->
<buildtool_depend>catkin</buildtool_depend>
<build_depend>nodelet</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>serial</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>message_generation</build_depend>
<run_depend>nodelet</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>serial</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>message_runtime</run_depend>
<!-- The export tag contains other, unspecified, tags -->
<export>
<nodelet plugin="${prefix}/mmWave_nodelets.xml" />
</export>
</package>
<?xml version="1.0"?>
<package>
<name>ti_mmwave_rospkg</name>
<version>3.3.0</version>
<description>The ti_mmwave_rospkg package. Publish messages with doppler information. Multi-sensor and camera overlay support. Modified by Leo Zhang</description>
<!-- One maintainer tag required, multiple allowed, one person per tag -->
<!-- Example: -->
<!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
<maintainer email="dr.leo.zhang@outlook.com">Leo Zhang</maintainer>
<!-- One license tag required, multiple allowed, one license per tag -->
<!-- Commonly used license strings: -->
<!-- BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
<license>BSD</license>
<!-- Url tags are optional, but multiple are allowed, one per tag -->
<!-- Optional attribute type can be: website, bugtracker, or repository -->
<!-- Example: -->
<url type="website">https://github.com/radar-lab/ti_mmwave_rospkg</url> -->
<!-- Author tags are optional, multiple are allowed, one per tag -->
<!-- Authors do not have to be maintainers, but could be -->
<!-- Example: -->
<author email="dr.leo.zhang@outlook.com">Leo Zhang</author>
<!-- The *_depend tags are used to specify dependencies -->
<!-- Dependencies can be catkin packages or system dependencies -->
<!-- Examples: -->
<!-- Use build_depend for packages you need at compile time: -->
<!-- <build_depend>message_generation</build_depend> -->
<!-- Use buildtool_depend for build tool packages: -->
<!-- <buildtool_depend>catkin</buildtool_depend> -->
<!-- Use run_depend for packages you need at runtime: -->
<!-- <run_depend>message_runtime</run_depend> -->
<!-- Use test_depend for packages you need only for testing: -->
<!-- <test_depend>gtest</test_depend> -->
<buildtool_depend>catkin</buildtool_depend>
<build_depend>nodelet</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>serial</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>message_generation</build_depend>
<run_depend>nodelet</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>serial</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>message_runtime</run_depend>
<!-- The export tag contains other, unspecified, tags -->
<export>
<nodelet plugin="${prefix}/mmWave_nodelets.xml" />
</export>
</package>

View File

@@ -0,0 +1,155 @@
/*
* @file ParameterParser.cpp
*
* @brief
* Calculates parameters from QuickConfig.
*
* \par
* NOTE:
* (C) Copyright 2020 Texas Instruments, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "ParameterParser.h"
namespace ti_mmwave_rospkg {
PLUGINLIB_EXPORT_CLASS(ti_mmwave_rospkg::ParameterParser, nodelet::Nodelet);
ParameterParser::ParameterParser() {}
void ParameterParser::onInit() {}
void ParameterParser::ParamsParser(ti_mmwave_rospkg::mmWaveCLI &srv, ros::NodeHandle &nh) {
// ROS_ERROR("%s",srv.request.comm.c_str());
// ROS_ERROR("%s",srv.response.resp.c_str());
std::vector <std::string> v;
std::string s = srv.request.comm.c_str();
std::istringstream ss(s);
std::string token;
std::string req;
int i = 0;
while (std::getline(ss, token, ' ')) {
v.push_back(token);
if (i > 0) {
if (!req.compare("profileCfg")) {
switch (i) {
case 2:
nh.setParam("/ti_mmwave/startFreq", std::stof(token)); break;
case 3:
nh.setParam("/ti_mmwave/idleTime", std::stof(token)); break;
case 4:
nh.setParam("/ti_mmwave/adcStartTime", std::stof(token)); break;
case 5:
nh.setParam("/ti_mmwave/rampEndTime", std::stof(token)); break;
case 8:
nh.setParam("/ti_mmwave/freqSlopeConst", std::stof(token)); break;
case 10:
nh.setParam("/ti_mmwave/numAdcSamples", std::stoi(token)); break;
case 11:
nh.setParam("/ti_mmwave/digOutSampleRate", std::stof(token)); break;
case 14:
nh.setParam("/ti_mmwave/rxGain", std::stof(token)); break;
}
} else if (!req.compare("frameCfg")) {
switch (i) {
case 1:
nh.setParam("/ti_mmwave/chirpStartIdx", std::stoi(token)); break;
case 2:
nh.setParam("/ti_mmwave/chirpEndIdx", std::stoi(token)); break;
case 3:
nh.setParam("/ti_mmwave/numLoops", std::stoi(token)); break;
case 4:
nh.setParam("/ti_mmwave/numFrames", std::stoi(token)); break;
case 5:
nh.setParam("/ti_mmwave/framePeriodicity", std::stof(token)); break;
}
}
} else req = token;
i++;
}
}
void ParameterParser::CalParams(ros::NodeHandle &nh) {
float c0 = 299792458;
int chirpStartIdx;
int chirpEndIdx;
int numLoops;
float framePeriodicity;
float startFreq;
float idleTime;
float adcStartTime;
float rampEndTime;
float digOutSampleRate;
float freqSlopeConst;
float numAdcSamples;
nh.getParam("/ti_mmwave/startFreq", startFreq);
nh.getParam("/ti_mmwave/idleTime", idleTime);
nh.getParam("/ti_mmwave/adcStartTime", adcStartTime);
nh.getParam("/ti_mmwave/rampEndTime", rampEndTime);
nh.getParam("/ti_mmwave/digOutSampleRate", digOutSampleRate);
nh.getParam("/ti_mmwave/freqSlopeConst", freqSlopeConst);
nh.getParam("/ti_mmwave/numAdcSamples", numAdcSamples);
nh.getParam("/ti_mmwave/chirpStartIdx", chirpStartIdx);
nh.getParam("/ti_mmwave/chirpEndIdx", chirpEndIdx);
nh.getParam("/ti_mmwave/numLoops", numLoops);
nh.getParam("/ti_mmwave/framePeriodicity", framePeriodicity);
int ntx = chirpEndIdx - chirpStartIdx + 1;
int nd = numLoops;
int nr = numAdcSamples;
float tfr = framePeriodicity * 1e-3;
float fs = digOutSampleRate * 1e3;
float kf = freqSlopeConst * 1e12;
float adc_duration = nr / fs;
float BW = adc_duration * kf;
float PRI = (idleTime + rampEndTime) * 1e-6;
float fc = startFreq * 1e9 + kf * (adcStartTime * 1e-6 + adc_duration / 2);
float vrange = c0 / (2 * BW);
float max_range = nr * vrange;
float max_vel = c0 / (2 * fc * PRI) / ntx;
float vvel = max_vel / nd;
nh.setParam("/ti_mmwave/num_TX", ntx);
nh.setParam("/ti_mmwave/f_s", fs);
nh.setParam("/ti_mmwave/f_c", fc);
nh.setParam("/ti_mmwave/BW", BW);
nh.setParam("/ti_mmwave/PRI", PRI);
nh.setParam("/ti_mmwave/t_fr", tfr);
nh.setParam("/ti_mmwave/max_range", max_range);
nh.setParam("/ti_mmwave/range_resolution", vrange);
nh.setParam("/ti_mmwave/max_doppler_vel", max_vel);
nh.setParam("/ti_mmwave/doppler_vel_resolution", vvel);
}
}

View File

@@ -0,0 +1,113 @@
/*
* @file mmWaveCommSrv.cpp
*
* @brief
* Communication service responsible for sending CLI commands to sensor.
*
* \par
* NOTE:
* (C) Copyright 2020 Texas Instruments, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "mmWaveCommSrv.hpp"
namespace ti_mmwave_rospkg
{
PLUGINLIB_EXPORT_CLASS(ti_mmwave_rospkg::mmWaveCommSrv, nodelet::Nodelet);
mmWaveCommSrv::mmWaveCommSrv() {}
void mmWaveCommSrv::onInit()
{
ros::NodeHandle private_nh = getPrivateNodeHandle();
ros::NodeHandle private_nh2("~"); // follow namespace for multiple sensors
private_nh2.getParam("command_port", mySerialPort);
private_nh2.getParam("command_rate", myBaudRate);
ROS_INFO("mmWaveCommSrv: command_port = %s", mySerialPort.c_str());
ROS_INFO("mmWaveCommSrv: command_rate = %d", myBaudRate);
commSrv = private_nh.advertiseService("/mmWaveCLI", &mmWaveCommSrv::commSrv_cb, this);
NODELET_DEBUG("mmWaveCommsrv: Finished onInit function");
}
bool mmWaveCommSrv::commSrv_cb(mmWaveCLI::Request &req , mmWaveCLI::Response &res) {
NODELET_DEBUG("mmWaveCommSrv: Port is \"%s\" and baud rate is %d", mySerialPort.c_str(), myBaudRate);
/*Open Serial port and error check*/
serial::Serial mySerialObject("", myBaudRate, serial::Timeout::simpleTimeout(1000));
mySerialObject.setPort(mySerialPort.c_str());
try {
mySerialObject.open();
} catch (std::exception &e1) {
ROS_INFO("mmWaveCommSrv: Failed to open User serial port with error: %s", e1.what());
ROS_INFO("mmWaveCommSrv: Waiting 20 seconds before trying again...");
try {
// Wait 20 seconds and try to open serial port again
ros::Duration(20).sleep();
mySerialObject.open();
} catch (std::exception &e2) {
ROS_ERROR("mmWaveCommSrv: Failed second time to open User serial port, error: %s", e1.what());
NODELET_ERROR("mmWaveCommSrv: Port could not be opened. Port is \"%s\" and baud rate is %d", mySerialPort.c_str(), myBaudRate);
return false;
}
}
/*Read any previous pending response(s)*/
while (mySerialObject.available() > 0)
{
mySerialObject.readline(res.resp, 1024, ":/>");
ROS_INFO("mmWaveCommSrv: Received (previous) response from sensor: '%s'", res.resp.c_str());
res.resp = "";
}
/*Send out command received from the client*/
ROS_INFO("mmWaveCommSrv: Sending command to sensor: '%s'", req.comm.c_str());
req.comm.append("\n");
int bytesSent = mySerialObject.write(req.comm.c_str());
/*Read output from mmwDemo*/
mySerialObject.readline(res.resp, 1024, ":/>");
ROS_INFO("mmWaveCommSrv: Received response from sensor: '%s'", res.resp.c_str());
mySerialObject.close();
return true;
}
}

View File

@@ -0,0 +1,89 @@
/*
* @file mmWaveDataHdl.cpp
*
* @brief
* Creates the data handler node and sets parameters.
*
* \par
* NOTE:
* (C) Copyright 2020 Texas Instruments, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "mmWaveDataHdl.hpp"
#include "DataHandlerClass.h"
namespace ti_mmwave_rospkg
{
PLUGINLIB_EXPORT_CLASS(ti_mmwave_rospkg::mmWaveDataHdl, nodelet::Nodelet);
mmWaveDataHdl::mmWaveDataHdl() {}
void mmWaveDataHdl::onInit()
{
ros::NodeHandle private_nh("~");
std::string mySerialPort;
std::string myFrameID;
int myBaudRate;
int myMaxAllowedElevationAngleDeg;
int myMaxAllowedAzimuthAngleDeg;
private_nh.getParam("data_port", mySerialPort);
private_nh.getParam("data_rate", myBaudRate);
private_nh.getParam("frame_id", myFrameID);
if (!(private_nh.getParam("max_allowed_elevation_angle_deg", myMaxAllowedElevationAngleDeg))) {
myMaxAllowedElevationAngleDeg = 90; // Use max angle if none specified
}
if (!(private_nh.getParam("max_allowed_azimuth_angle_deg", myMaxAllowedAzimuthAngleDeg))) {
myMaxAllowedAzimuthAngleDeg = 90; // Use max angle if none specified
}
ROS_INFO("mmWaveDataHdl: data_port = %s", mySerialPort.c_str());
ROS_INFO("mmWaveDataHdl: data_rate = %d", myBaudRate);
ROS_INFO("mmWaveDataHdl: max_allowed_elevation_angle_deg = %d", myMaxAllowedElevationAngleDeg);
ROS_INFO("mmWaveDataHdl: max_allowed_azimuth_angle_deg = %d", myMaxAllowedAzimuthAngleDeg);
DataUARTHandler DataHandler(&private_nh);
DataHandler.setFrameID( (char*) myFrameID.c_str() );
DataHandler.setUARTPort( (char*) mySerialPort.c_str() );
DataHandler.setBaudRate( myBaudRate );
DataHandler.setMaxAllowedElevationAngleDeg( myMaxAllowedElevationAngleDeg );
DataHandler.setMaxAllowedAzimuthAngleDeg( myMaxAllowedAzimuthAngleDeg );
DataHandler.start();
NODELET_DEBUG("mmWaveDataHdl: Finished onInit function");
}
}

View File

@@ -0,0 +1,60 @@
/*
* @file mmWaveLoader.cpp
*
* @brief
* Creates the mmWave Manager node.
*
* \par
* NOTE:
* (C) Copyright 2019 Texas Instruments, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "ros/ros.h"
#include "nodelet/loader.h"
int main(int argc, char **argv)
{
ros::init(argc, argv, "mmWave_Manager");
nodelet::Loader manager(true);
nodelet::M_string remap(ros::names::getRemappings());
nodelet::V_string nargv;
manager.load("mmWaveCommSrv", "ti_mmwave_rospkg/mmWaveCommSrv", remap, nargv);
manager.load("mmWaveDataHdl", "ti_mmwave_rospkg/mmWaveDataHdl", remap, nargv);
ros::spin();
return 0;
}

View File

@@ -0,0 +1,99 @@
/*
* @file mmWaveQuickConfig.cpp
*
* @brief
* Reads the cfg file and calls service to send commands.
*
* \par
* NOTE:
* (C) Copyright 2020 Texas Instruments, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "ros/ros.h"
#include "ti_mmwave_rospkg/mmWaveCLI.h"
#include <cstdlib>
#include <fstream>
#include <stdio.h>
#include <regex>
#include "ParameterParser.h"
int main(int argc, char **argv) {
ros::init(argc, argv, "mmWaveQuickConfig");
ros::NodeHandle nh;
ti_mmwave_rospkg::mmWaveCLI srv;
if (argc != 2) {
ROS_INFO("mmWaveQuickConfig: usage: mmWaveQuickConfig /file_directory/params.cfg");
return 1;
} else
ROS_INFO("mmWaveQuickConfig: Configuring mmWave device using config file: %s", argv[1]);
ros::ServiceClient client = nh.serviceClient<ti_mmwave_rospkg::mmWaveCLI>("/mmWaveCLI");
std::ifstream myParams;
ti_mmwave_rospkg::ParameterParser parser;
//wait for service to become available
ros::service::waitForService("/mmWaveCLI", 10000);
//wait 0.5 secs to avoid multi-sensor conflicts
ros::Duration(0.5).sleep();
myParams.open(argv[1]);
if (myParams.is_open()) {
while( std::getline(myParams, srv.request.comm)) {
// Remove Windows carriage-return if present
srv.request.comm.erase(std::remove(srv.request.comm.begin(), srv.request.comm.end(), '\r'), srv.request.comm.end());
// Ignore comment lines (first non-space char is '%') or blank lines
if (!(std::regex_match(srv.request.comm, std::regex("^\\s*%.*")) || std::regex_match(srv.request.comm, std::regex("^\\s*")))) {
// ROS_INFO("mmWaveQuickConfig: Sending command: '%s'", srv.request.comm.c_str() );
if (client.call(srv)) {
if (std::regex_search(srv.response.resp, std::regex("Done"))) {
// ROS_INFO("mmWaveQuickConfig: Command successful (mmWave sensor responded with 'Done')");
parser.ParamsParser(srv, nh);
} else {
ROS_ERROR("mmWaveQuickConfig: Command failed (mmWave sensor did not respond with 'Done')");
ROS_ERROR("mmWaveQuickConfig: Response: '%s'", srv.response.resp.c_str() );
return 1;
}
} else {
ROS_ERROR("mmWaveQuickConfig: Failed to call service mmWaveCLI");
ROS_ERROR("%s", srv.request.comm.c_str() );
return 1;
}
}
}
parser.CalParams(nh);
myParams.close();
} else {
ROS_ERROR("mmWaveQuickConfig: Failed to open File %s", argv[1]);
return 1;
}
ROS_INFO("mmWaveQuickConfig: mmWaveQuickConfig will now terminate. Done configuring mmWave device using config file: %s", argv[1]);
return 0;
}

View File

@@ -1,3 +1,3 @@
string comm
---
string resp
string comm
---
string resp

View File

@@ -0,0 +1,211 @@
cmake_minimum_required(VERSION 3.0.2)
project(ti_safety_bubble)
## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
message_generation
geometry_msgs
)
## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)
## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()
################################################
## Declare ROS messages, services and actions ##
################################################
## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
## * add a build_depend tag for "message_generation"
## * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET
## * If MSG_DEP_SET isn't empty the following dependency has been pulled in
## but can be declared for certainty nonetheless:
## * add a exec_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
## * add "message_generation" and every package in MSG_DEP_SET to
## find_package(catkin REQUIRED COMPONENTS ...)
## * add "message_runtime" and every package in MSG_DEP_SET to
## catkin_package(CATKIN_DEPENDS ...)
## * uncomment the add_*_files sections below as needed
## and list every .msg/.srv/.action file to be processed
## * uncomment the generate_messages entry below
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
## Generate messages in the 'msg' folder
add_message_files(
FILES
Num.msg
)
## Generate services in the 'srv' folder
add_service_files(
FILES
AddTwoInts.srv
)
## Generate actions in the 'action' folder
# add_action_files(
# FILES
# Action1.action
# Action2.action
# )
## Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
std_msgs
)
################################################
## Declare ROS dynamic reconfigure parameters ##
################################################
## To declare and build dynamic reconfigure parameters within this
## package, follow these steps:
## * In the file package.xml:
## * add a build_depend and a exec_depend tag for "dynamic_reconfigure"
## * In this file (CMakeLists.txt):
## * add "dynamic_reconfigure" to
## find_package(catkin REQUIRED COMPONENTS ...)
## * uncomment the "generate_dynamic_reconfigure_options" section below
## and list every .cfg file to be processed
## Generate dynamic reconfigure parameters in the 'cfg' folder
# generate_dynamic_reconfigure_options(
# cfg/DynReconf1.cfg
# cfg/DynReconf2.cfg
# )
###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if your package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES beginner_tutorials
# CATKIN_DEPENDS roscpp rospy std_msgs
# DEPENDS system_lib
CATKIN_DEPENDS message_runtime
)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
# include
${catkin_INCLUDE_DIRS}
)
## Declare a C++ library
# add_library(${PROJECT_NAME}
# src/${PROJECT_NAME}/beginner_tutorials.cpp
# )
## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure
# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
# add_executable(${PROJECT_NAME}_node src/beginner_tutorials_node.cpp)
## Rename C++ executable without prefix
## The above recommended prefix causes long target names, the following renames the
## target back to the shorter version for ease of user use
## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")
## Add cmake target dependencies of the executable
## same as for the library above
# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
## Specify libraries to link a library or executable target against
# target_link_libraries(${PROJECT_NAME}_node
# ${catkin_LIBRARIES}
# )
#############
## Install ##
#############
# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# catkin_install_python(PROGRAMS
# scripts/my_python_script
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )
## Mark executables for installation
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html
# install(TARGETS ${PROJECT_NAME}_node
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )
## Mark libraries for installation
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html
# install(TARGETS ${PROJECT_NAME}
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
# )
## Mark cpp header files for installation
# install(DIRECTORY include/${PROJECT_NAME}/
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
# FILES_MATCHING PATTERN "*.h"
# PATTERN ".svn" EXCLUDE
# )
## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
# # myfile1
# # myfile2
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )
#############
## Testing ##
#############
## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_beginner_tutorials.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()
## Add folders to be run by python nosetests
# catkin_add_nosetests(test)
add_executable(odomListener src/odomListener.cpp)
target_link_libraries(odomListener ${catkin_LIBRARIES})
add_dependencies(odomListener ti_safety_bubble_generate_messages_cpp)

View File

@@ -0,0 +1,10 @@
<launch>
<node pkg="tf" type="static_transform_publisher" name="slow_tf" args="0 0 0 0 0 0 base_link slowzone 100"/>
<node pkg="tf" type="static_transform_publisher" name="stop_tf" args="0 0 0 0 0 0 base_link stopzone 100"/>
<node name="odomListener" pkg="ti_safety_bubble" type="odomListener" output="screen" >
<param name="slow_radius" value="2.0" />
<param name="stop_radius" value="1.0" />
<param name="clear_costmap_period_secs" value="5" />
</node>
</launch>

View File

@@ -0,0 +1 @@
int64 num

View File

@@ -0,0 +1,77 @@
<?xml version="1.0"?>
<package format="2">
<name>ti_safety_bubble</name>
<version>0.0.0</version>
<description>The beginner_tutorials package</description>
<!-- One maintainer tag required, multiple allowed, one person per tag -->
<!-- Example: -->
<!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
<maintainer email="sabeeh@todo.todo">sabeeh</maintainer>
<!-- One license tag required, multiple allowed, one license per tag -->
<!-- Commonly used license strings: -->
<!-- BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
<license>TODO</license>
<!-- Url tags are optional, but multiple are allowed, one per tag -->
<!-- Optional attribute type can be: website, bugtracker, or repository -->
<!-- Example: -->
<!-- <url type="website">http://wiki.ros.org/beginner_tutorials</url> -->
<!-- Author tags are optional, multiple are allowed, one per tag -->
<!-- Authors do not have to be maintainers, but could be -->
<!-- Example: -->
<!-- <author email="jane.doe@example.com">Jane Doe</author> -->
<!-- The *depend tags are used to specify dependencies -->
<!-- Dependencies can be catkin packages or system dependencies -->
<!-- Examples: -->
<!-- Use depend as a shortcut for packages that are both build and exec dependencies -->
<!-- <depend>roscpp</depend> -->
<!-- Note that this is equivalent to the following: -->
<!-- <build_depend>roscpp</build_depend> -->
<!-- <exec_depend>roscpp</exec_depend> -->
<!-- Use build_depend for packages you need at compile time: -->
<!-- <build_depend>message_generation</build_depend> -->
<!-- Use build_export_depend for packages you need in order to build against this package: -->
<!-- <build_export_depend>message_generation</build_export_depend> -->
<!-- Use buildtool_depend for build tool packages: -->
<!-- <buildtool_depend>catkin</buildtool_depend> -->
<!-- Use exec_depend for packages you need at runtime: -->
<!-- <exec_depend>message_runtime</exec_depend> -->
<!-- Use test_depend for packages you need only for testing: -->
<!-- <test_depend>gtest</test_depend> -->
<!-- Use doc_depend for packages you need only for building documentation: -->
<!-- <doc_depend>doxygen</doc_depend> -->
<buildtool_depend>catkin</buildtool_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>std_msgs</build_depend>
<build_export_depend>roscpp</build_export_depend>
<build_export_depend>rospy</build_export_depend>
<build_export_depend>std_msgs</build_export_depend>
<exec_depend>roscpp</exec_depend>
<exec_depend>rospy</exec_depend>
<exec_depend>std_msgs</exec_depend>
<build_depend>message_generation</build_depend>
<exec_depend>message_runtime</exec_depend>
<build_depend>nav_msgs</build_depend>
<exec_depend>nav_msgs</exec_depend>
<build_depend>geometry_msgs</build_depend>
<exec_depend>geometry_msgs</exec_depend>
<!-- The export tag contains other, unspecified, tags -->
<export>
<!-- Other tools can request additional information be placed here -->
</export>
</package>

View File

@@ -0,0 +1,211 @@
/*
* @file odomListener.cpp
*
* @brief
* Subscribes to the global obstacle layers's costmap and footprint nodes,
* publishes velocities based on the .
*
* \par
* NOTE:
* (C) Copyright 2020 Texas Instruments, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <math.h>
#include "ros/ros.h"
#include "std_msgs/String.h"
#include "std_srvs/Empty.h"
#include "nav_msgs/OccupancyGrid.h"
#include "geometry_msgs/PolygonStamped.h"
#include "geometry_msgs/Point32.h"
#include "geometry_msgs/Twist.h"
double robotX, robotY;
nav_msgs::OccupancyGrid gMsg;
/**
* This callback receives the robot's polygon and calculates the center.
* The center point will be used to calculate distances to objects.
*/
void footprintCallback(const geometry_msgs::PolygonStamped::ConstPtr& msg)
{
//ROS_INFO("I heard: [%s]", msg->data.c_str());
//ROS_INFO("[%3.3f], [%3.3f]", msg->pose.pose.position.x,msg->pose.pose.position.y);
//geometry_msgs::Point32 p
double x, y;
int s = (int) msg->polygon.points.size();
if (s == 0)
return;
x = 0.0;
y = 0.0;
for (int i = 0; i < s; i++)
{
x += msg->polygon.points[i].x;
y += msg->polygon.points[i].y;
}
robotX = x / (double) s;
robotY = y / (double) s;
}
/**
* This callback saves the global costmap to the gMsg variable.
*/
void mapCallback(const nav_msgs::OccupancyGrid::ConstPtr& msg)
{
gMsg = *msg;
}
/**
* Calculates the distance between p1 and p2.
*/
double calculateDistance(double p1x, double p1y, double p2x, double p2y)
{
return sqrt(pow(p1x - p2x, 2) + pow(p1y - p2y, 2));
}
int main(int argc, char **argv)
{
ros::init(argc, argv, "odomListener");
ros::NodeHandle n;
ros::NodeHandle n2("~");
ros::Subscriber footprintSub = n.subscribe("/move_base/global_costmap/footprint", 10, footprintCallback);
ros::Subscriber mapSub = n.subscribe("/move_base/global_costmap/costmap", 10, mapCallback);
ros::ServiceClient client = n.serviceClient<std_srvs::Empty>("/move_base/clear_costmaps");
std_srvs::Empty srv;
ros::Publisher vel_pub = n.advertise<geometry_msgs::Twist>("mobile_base/commands/velocity", 1);
ros::Publisher slowzone_pub = n.advertise<geometry_msgs::PolygonStamped>("/ti_base/slowzone", 1);
ros::Publisher stopzone_pub = n.advertise<geometry_msgs::PolygonStamped>("/ti_base/stopzone", 1);
double outerLimit = 1.5; //radius in meters
double innerLimit = 1.0; //radius in meters
double mapsClearTime = 7.5; //seconds
n2.getParam("slow_radius", outerLimit);
n2.getParam("stop_radius", innerLimit);
n2.getParam("clear_costmap_period_secs", mapsClearTime);
double rate = 20;
ros::Rate loop_rate(rate);
int counter = 0;
bool stopFlag = false;
bool slowFlag = false;
while (ros::ok())
{
if (gMsg.info.width != 0) {
double tempRobotX = robotX;
double tempRobotY = robotY;
stopFlag = false;
slowFlag = false;
// create polygons for zones
geometry_msgs::PolygonStamped slowzone;
geometry_msgs::PolygonStamped stopzone;
slowzone.header.frame_id = "slowzone";
stopzone.header.frame_id = "stopzone";
int numPoints = 12; // number of points for polygon
for (int i = 0; i < numPoints; ++i) {
double angle = i * ( 360.0 / (double) numPoints) * M_PI / 180.0;
geometry_msgs::Point32 slow_point, stop_point;
slow_point.z = 0.0;
stop_point.z = 0.0;
slow_point.x = cos(angle) * outerLimit;
slow_point.y = sin(angle) * outerLimit;
stop_point.x = cos(angle) * innerLimit;
stop_point.y = sin(angle) * innerLimit;
slowzone.polygon.points.push_back(slow_point);
stopzone.polygon.points.push_back(stop_point);
}
slowzone_pub.publish(slowzone);
stopzone_pub.publish(stopzone);
// calculate distance to objects
for (int i = 0; i < gMsg.info.height; i++)
{
for (int j = 0; j < gMsg.info.width; j++)
{
int ind = (i * gMsg.info.width) + j;
// grid spaces with probability of 80 or higher will have distance calculated
if (gMsg.data[ind] >= 80)
{
double px = (i * gMsg.info.resolution) + gMsg.info.origin.position.x;
double py = (j * gMsg.info.resolution) + gMsg.info.origin.position.y;
double dist = calculateDistance(tempRobotX, tempRobotY, py, px);
if (outerLimit > dist && dist > innerLimit)
{
slowFlag = true;
} else if (innerLimit >= dist)
{
stopFlag = true;
}
}
}
}
// publish velocity command
geometry_msgs::Twist vel;
// hard-coded angular velocity to offset turtlebot2 from straying to the left
vel.angular.z = -0.0075;
if (stopFlag) {
ROS_INFO("STOP");
vel.linear.x = 0.0;
vel.angular.z = 0.0;
} else if (slowFlag) {
ROS_INFO("SLOW");
vel.linear.x = 0.1;
} else {
ROS_INFO("FULL");
vel.linear.x = 0.2;
}
vel_pub.publish(vel);
}
// calls move_base service to clear costmaps
counter += 1;
if (counter > (int) (rate * mapsClearTime)) {
if (client.call(srv))
{
ROS_INFO("maps cleared");
} else {
ROS_INFO("can't call service");
}
counter = 0;
}
ros::spinOnce();
loop_rate.sleep();
}
return 0;
}

View File

@@ -0,0 +1,4 @@
int64 a
int64 b
---
int64 sum

Some files were not shown because too many files have changed in this diff Show More