Skip to content

Commit

Permalink
Merge pull request #5 from kavyadevd/phase_2
Browse files Browse the repository at this point in the history
Phase 2 merge
  • Loading branch information
kavyadevd authored Dec 13, 2021
2 parents 3908527 + d3fa55b commit ab213da
Show file tree
Hide file tree
Showing 66 changed files with 17,517 additions and 147 deletions.
140 changes: 25 additions & 115 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
cmake_minimum_required(VERSION 3.0.2)
project(swarm_robots)

## 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
std_msgs
Expand All @@ -21,91 +15,6 @@ find_package(octomap REQUIRED)
find_package(Eigen3 REQUIRED)


## 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
# Message1.msg
# Message2.msg
# )

## Generate services in the 'srv' folder
# add_service_files(
# FILES
# Service1.srv
# Service2.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 swarm_robots
Expand All @@ -127,30 +36,7 @@ include_directories(

)

## Declare a C++ library
# add_library(${PROJECT_NAME}
# src/${PROJECT_NAME}/swarm_robots.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/swarm_master.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})
add_executable(${PROJECT_NAME}_node src/swarm_master.cpp src/arena.cpp)

## Specify libraries to link a library or executable target against
target_link_libraries(${PROJECT_NAME}_node
Expand Down Expand Up @@ -211,3 +97,27 @@ add_executable(${PROJECT_NAME}_node src/swarm_master.cpp)

## Add folders to be run by python nosetests
# catkin_add_nosetests(test)


#############
## Testing ##
#############

if(CATKIN_ENABLE_TESTING)
find_package(rostest REQUIRED)

add_rostest_gtest(
TestSwarm
test/main.cpp
test/testswarm.cpp
)
target_link_libraries(
TestSwarm
${catkin_LIBRARIES}
)
add_dependencies(
TestSwarm
##${PROJECT_NAME}_swarm_test_cpp
${catkin_EXPORTED_TARGETS}
)
endif()
63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,69 @@ The project will be developed using industry-grade agile methodologies. The agil

[AIP Spreadsheet](https://docs.google.com/spreadsheets/d/1eQ78AiMMgUXJpQEjbjUjjJoJ0I1oSbPfRSU09nT6VKE/edit?usp=sharing)

### Installations

It is assumed that the system has Ubuntu 18.04 and above with ROS Melodic/Noetic installed.
If not, install Ubuntu from [here](https://ubuntu.com/download/desktop) and ROS from [here](http://wiki.ros.org/melodic/Installation/Ubuntu)

#### First step is to install Jackal robot
```bash
sudo apt-get install ros-melodic-jackal-simulator ros-melodic-jackal-desktop
cd ~
mkdir -p swarm_robots/src
cd swarm_robots/src && catkin_init_workspace
git clone https://github.com/jackal/jackal.git
git clone https://github.com/jackal/jackal_simulator.git
git clone https://github.com/clearpathrobotics/LMS1xx.git
git clone https://github.com/ros-drivers/pointgrey_camera_driver.git
cd ..
catkin_make
```

#### Clone git repository
```bash
cd swarm_robots/src
git clone --recursive https://github.com/kavyadevd/swarm_robots.git
```

#### Execute program
```bash
catkin_make
roslaunch swarm_robots main.launch
```

### Running ROS test/ Gtest

To make the test files execute the following commands successively
```bash
catkin_make tests
catkin_make test
```

Output will be similiar to :

```bash
... logging to /home/kavya/.ros/log/rostest-Matrix-27255.log
[ROSUNIT] Outputting test results to /home/kavya/.ros/test_results/swarm_robots
/rostest-test_testswarm.xml
[ WARN] [1636828912.923804367]: Publisher message will be changed.
[Testcase: testtestswarm] ... ok

[ROSTEST]-----------------------------------------------------------------------

[swarm_robots.rosunit-testswarm/TestArentsInit][passed]
[swarm_robots.rosunit-testswarm/TestSwarmSize][passed]

SUMMARY
* RESULT: SUCCESS
* TESTS: 2
* ERRORS: 0
* FAILURES: 0

rostest log file is in /home/kavya/.ros/log/rostest-Matrix-27255.log

```

## Licensing
The project is licensed under the [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause). Click [here](https://github.com/kavyadevd/swarm_robots/blob/main/LICENSE) to know more

44 changes: 44 additions & 0 deletions Results/cppcheckoutput.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Checking include/swarm_robots/agent.h ...
1/22 files checked 10% done
Checking include/swarm_robots/agent_node.h ...
2/22 files checked 16% done
Checking include/swarm_robots/arena.h ...
3/22 files checked 25% done
Checking include/swarm_robots/forward_kinematics.h ...
4/22 files checked 32% done
Checking include/swarm_robots/inverse_kinematics.h ...
5/22 files checked 39% done
Checking include/swarm_robots/obstacle.h ...
6/22 files checked 39% done
Checking include/swarm_robots/path_planner.h ...
7/22 files checked 50% done
Checking include/swarm_robots/safety_check.h ...
8/22 files checked 58% done
Checking include/swarm_robots/state.h ...
9/22 files checked 62% done
Checking include/swarm_robots/swarm_master.h ...
10/22 files checked 66% done
Checking src/agent.cpp ...
11/22 files checked 70% done
Checking src/arena.cpp ...
12/22 files checked 74% done
Checking src/forward_kinematics.cpp ...
13/22 files checked 74% done
Checking src/inverse_kinematics.cpp ...
14/22 files checked 74% done
Checking src/main.cpp ...
15/22 files checked 75% done
Checking src/obstacle.cpp ...
16/22 files checked 75% done
Checking src/path_planner.cpp ...
17/22 files checked 85% done
Checking src/safety_check.cpp ...
18/22 files checked 85% done
Checking src/state.cpp ...
19/22 files checked 85% done
Checking src/swarm_master.cpp ...
20/22 files checked 88% done
Checking test/main.cpp ...
21/22 files checked 93% done
Checking test/testswarm.cpp ...
22/22 files checked 100% done
13 changes: 13 additions & 0 deletions Results/cpplintoutput.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Done processing ./src/agent.cpp
Done processing ./src/arena.cpp
Done processing ./src/forward_kinematics.cpp
Done processing ./src/inverse_kinematics.cpp
Done processing ./src/main.cpp
Done processing ./src/obstacle.cpp
Done processing ./src/path_planner.cpp
Done processing ./src/safety_check.cpp
Done processing ./src/state.cpp
Done processing ./src/swarm_master.cpp
Done processing ./test/main.cpp
Done processing ./test/testswarm.cpp
Total errors found: 15
Loading

0 comments on commit ab213da

Please sign in to comment.