fathom_radiant

所属分类:编程语言基础
开发工具:CMake
文件大小:0KB
下载次数:0
上传日期:2023-08-04 01:40:17
上 传 者sh-1993
说明:  英寻辐射编程挑战,
(fathom radiant programming challenge,)

文件列表:
CMakeLists.txt (7575, 2023-08-04)
launch/ (0, 2023-08-04)
launch/data_cpp.launch (485, 2023-08-04)
launch/data_python.launch (417, 2023-08-04)
msg/ (0, 2023-08-04)
msg/CustomData.msg (148, 2023-08-04)
msg/DiffData.msg (46, 2023-08-04)
package.xml (3059, 2023-08-04)
src/ (0, 2023-08-04)
src/Dataset.csv (2791053, 2023-08-04)
src/pub.py (2108, 2023-08-04)
src/pubs.cpp (2681, 2023-08-04)
src/sub.py (828, 2023-08-04)
src/subs.cpp (1220, 2023-08-04)
test/ (0, 2023-08-04)
test/test_publisher.py (1518, 2023-08-04)
test/test_subscriber.py (2206, 2023-08-04)

# fathom_radiant Programming Challenge: ROS1 The aim of this project is to read the csv file and compute the time difference between each row and compare with the existing ground truth in dataset. This project reads the existing Dataset.csv in fathom_radiant/src folder. Hence, no need to provide path for csv. I have also ensured if the user has a preference for providing csv path, he can provide it in the launch file as a ros param and comment out to modify the code accordingly. Though the project requires me to complete using ROS2. My PC doesn't have enough resources and system requirements to install *ROS2*, *Calcon*. Hence, I am using Ubuntu 18.0.4 ROS1 melodic for this project to simplify and complete it within 4hrs time. ## Developer: **Nagarjun Vinukonda** ## Pre-requisites: The following software needs to be installed ahead: **Note:** This package is for Ubuntu 18.0.4 ROS1 Melodic i.e. Python 2.7. If system is Ubuntu 18.0.4 install [ROS Melodic](http://wiki.ros.org/melodic/Installation/Ubuntu) I have also built cpp files for the same project. In case the user wants to run on higher Ubuntu version like 20.0.4. This should help out of Python version conflicts with higher version of Ubuntu ROS1. Colcon notes:
* Colcon is not supported for Ubuntu 18.0.4 ROS1 version. Hence we will be doing catkin_make. Although there are experimental packages of Colcon which might cause conflict problems
* Reason:- One of the reasons is Colcon uses Python3 and ROS Melodic by default is Python 2.7. Which brings conflicts.
[Colcon for ros1 ubuntu 20.0.4](https://colcon.readthedocs.io/en/released/user/installation.html) Installation:
``` sudo apt update sudo apt install python3-colcon-common-extensions ``` If you want to install using pip:
``` pip install -U colcon-common-extensions ``` ## Project building: Create catkin_ws or any workspace with your name:
``` mkdir -p ~/catkin_ws/src cd ~/catkin_ws/ ``` * Note: If you choose to use catkin_make which is stable, do catkin_make after creating catkin_ws: ``` catkin_make ``` Download this repo and put it in the src folder of the catkin_ws and unzip it. ``` cd ~/catkin_ws/src/ git clone https://github.com/nagarjunvinukonda/fathom_radiant.git ``` ### Build using catkin_make Perform catkin_make after downloading:
``` cd ~/catkin_ws/ catkin_make ``` ### Build using Colcon ``` cd ~/catkin_ws/ colcon build ``` Now source your catkin_ws:
`source devel/setup.bash` ## Parameters specification: If User wants to specify path of the .csv file please specify in data_python.launch or data_cpp.launch in the value section, in the ros param section.
## Running the project: Open terminal: ``` cd catkin_ws roslaunch fathom_radiant data_python.launch ``` In case you are running on higher version and having ROS melodic Python2.7 conflicts. I ensure to create c++ scripts to run the project on different versions of Ubuntu with ROS1 version. ``` cd catkin_ws roslaunch fathom_radiant data_cpp.launch ``` ### Running testing framework Once you have launched the publisher and subscriber scripts using the launch file. Now you can run unit tests for publisher and subscriber
Unit test for publisher: ``` rosrun fathom_radiant test_publisher.py ``` Unit test for subscriber: ``` rosrun fathom_radiant test_subscriber.py ``` ### Information on tests: The test_publsiher:
1) test_publishing_data_types: It checks for correct data types in the message file as expected from CSV. 2) test_publishing_topic_publish: It checks if the topic '/data' is published or not
The test_subscriber:
1) test_subscriber_dataLength: It checks if the topic '/diff' is published or not, the message time difference data type is float and the length of the message received is >0 and exists. 2) test_subscribing_dataDiff: It checks if the time difference computed from '/diff' and the time difference available in .csv are equal or not ## Do's & Dont's: **Note:** Please dont change the location of .csv file if you are not providing csv path as the ros param in data_python.launch or data_cpp.launch. ## Process of Project: The pub.py node publishes topic called "/data" after reading Dataset.csv file. "Longitude, Latitude, Altitude, Time and Actual_Speed" along with "Time_diff" for testing using CustomData.msg. Later the sub.py node subscribes "/data" topic and computes the time difference between current and previous "Time" and publishes to "/diff" topic via DiffData.msg. ## Directory structure: ``` fathom_radiant/ ├── CMakeLists.txt ├── launch │ └── data_python.launch │ └── data_cpp.launch ├── msg │ └── CustomData.msg │ └── DiffData.msg ├── package.xml | ├── src │ ├── pub.py │ └── sub.py │ └── Dataset.csv │ ├── pubs.cpp │ └── subs.cpp └── test ├── test_publisher.py └── test_subscriber.py ``` ## output: Once data_python.launch has launched.
Dont forget to source your repo on the terminal.
``` source devel/setup.bash ``` To visualize final time diff: ``` rostopic echo /diff ``` To vizualize data from .csv: ``` rostopic echo /data ```

近期下载者

相关文件


收藏者