Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
189 commits
Select commit Hold shift + click to select a range
ccc6796
hotfix playmake
mahi97 Nov 13, 2018
27ecfaa
add add gameController protofiles(just the referee commands)
kianbehzad Feb 2, 2019
d3a56e0
use new referee proto files instead of the old ones in referee node
kianbehzad Feb 2, 2019
d8798fc
created the GoToPointAvoid,Kick and Receive in Gui for using setting …
kasrakhalafi Feb 8, 2019
042b28a
added radius and penalty area
Lhumd Feb 8, 2019
1484311
developmenet of teamTOcontroller gamecontroller
kianbehzad Feb 8, 2019
235f522
publish mouse pos in graphical client plugin on /mousePos topic
kianbehzad Feb 9, 2019
fe39d9f
team registration and goalie assignment at first
kianbehzad Feb 10, 2019
9fc4742
now the decider_node publishes the result list of all robot fualts
kianbehzad Feb 10, 2019
4c4d0a3
add a explanation at the begining of the node
kianbehzad Feb 10, 2019
65e8394
[fixbug] reset all status in every loop
kianbehzad Feb 10, 2019
728ff8e
update ai fualtdetection with the new autodecider approch
kianbehzad Feb 10, 2019
253654b
reimplementation for robot substitution
kianbehzad Feb 11, 2019
0fb20e4
add //[substitution] comments in every related sections
kianbehzad Feb 11, 2019
6382de9
baby steps of converting substitution from role to play
kianbehzad Feb 11, 2019
feea650
[DONE] it works fine
kianbehzad Feb 11, 2019
eac229a
final touch
kianbehzad Feb 11, 2019
1dcdca0
Merge branch 'master' of https://github.com/ParsianRoboticLab/ssl int…
kasrakhalafi Feb 12, 2019
a956442
Merge branch 'GraphicalMousePos' of https://github.com/ParsianRobotic…
kasrakhalafi Feb 12, 2019
5085093
fix normal penalty issues for kicker
mahi97 Feb 12, 2019
257b1b0
TaskRunner done! Graphical mouse pos and OneTouch added
kasrakhalafi Feb 14, 2019
f9b2d65
TaskRunner done! Graphical mouse pos and OneTouch added
kasrakhalafi Feb 14, 2019
d528fdb
add add gameController protofiles(just the referee commands)
kianbehzad Feb 2, 2019
e33e551
use new referee proto files instead of the old ones in referee node
kianbehzad Feb 2, 2019
53c288d
add parsianWorkshop item in ai config - robots wont go too divar
kianbehzad Feb 13, 2019
6875673
change constants
Lhumd Feb 14, 2019
ac3f18e
.
Lhumd Feb 15, 2019
1b5f71d
add plans
Lhumd Feb 15, 2019
c2a1543
fix complex method
Lhumd Feb 15, 2019
e74b77e
Merge pull request #62 from ParsianRoboticLab/control
Lhumd Feb 15, 2019
43e0aa9
MaxWidth added for Taskrunner in gui
kasrakhalafi Feb 15, 2019
4ab8f57
Merge branch 'develop' of https://github.com/ParsianRoboticLab/ssl in…
Lhumd Feb 16, 2019
963aca3
stablize gamecontroller node and implement goalie assignment feature …
kianbehzad Feb 20, 2019
ab4a909
Merge branch 'autofualtreimplement_kian' of https://github.com/Parsia…
kianbehzad Feb 20, 2019
a83a74d
get permission from game_controller to substitute a robot (publish th…
kianbehzad Feb 21, 2019
0e951da
make ai substitute process compatible with game_controller node, also…
kianbehzad Feb 21, 2019
79b38f3
add auto_decider and game_controller node too launch files
kianbehzad Feb 21, 2019
d22b072
final touch :)
kianbehzad Feb 21, 2019
c4d9839
change gameState
Lhumd Mar 12, 2019
9c52994
fix TEST gameStates
Lhumd Mar 12, 2019
ae9361e
add deps.sh file
kianbehzad Mar 12, 2019
b47906d
TODO done
kianbehzad Mar 12, 2019
3f33a41
mahi bug found by test on 97.12.20
amirbayat98 Mar 12, 2019
675ca23
Merge pull request #68 from ParsianRoboticLab/amir
Lhumd Mar 12, 2019
8d60e0f
Merge pull request #69 from ParsianRoboticLab/game_controller
Lhumd Mar 12, 2019
6457fff
just a dummy commit
kianbehzad Mar 12, 2019
8b5dd59
Merge pull request #71 from ParsianRoboticLab/TaskRunner
kianbehzad Mar 12, 2019
1e49c12
delete useless variables and functions
Lhumd Mar 12, 2019
6ce0422
change gameState
Lhumd Mar 12, 2019
e138cf2
fix TEST gameStates
Lhumd Mar 12, 2019
ceda032
delete useless variables and functions
Lhumd Mar 12, 2019
c39b563
change penaltyMode
Lhumd Mar 12, 2019
829e15b
penaltyMode checked
Lhumd Mar 12, 2019
cfe9bf0
add protobuf for python2 dep in deps.sh(gameController)
rebinnaf Mar 14, 2019
7dc2cce
create deafault rqt windows with graphical respawn (just use parsian …
rebinnaf Mar 14, 2019
3c725d0
change shoot out
Lhumd Mar 14, 2019
3cf1572
Merge pull request #72 from ParsianRoboticLab/parsian_script
Lhumd Mar 14, 2019
a5077c0
fix our penalty shootout
Lhumd Mar 14, 2019
cef18a2
rebase penalty and shootout
Lhumd Mar 14, 2019
6e8ba73
change executeGoalKeeper task
Lhumd Mar 15, 2019
dd6fb01
Merge branch 'penalty_kian' of https://github.com/ParsianRoboticLab/s…
amirbayat98 Mar 15, 2019
00843eb
rebase setGoalKeeperState
Lhumd Mar 16, 2019
47bc4dd
rebase setGoalKeeperTargetPoint
Lhumd Mar 18, 2019
c6e8ce2
starting with update plan feature in plan server
kianbehzad Mar 19, 2019
800242a
seperate all desired and undesired or broken json files
kianbehzad Mar 19, 2019
2e0321c
preparing for generating message from json files
kianbehzad Mar 19, 2019
5557911
ignore all plans except for test.json
kianbehzad Mar 19, 2019
91b880e
need to change branches :(
kianbehzad Mar 19, 2019
1fb3552
convert agents part of jsonfiles into messages
kianbehzad Mar 19, 2019
8274adf
just forget too add agent too actual message
kianbehzad Mar 19, 2019
89ce8ea
get all desired json files and parse them into plan_message [completed]
kianbehzad Mar 20, 2019
663c284
finding desired plans is completely tested and works fine - ai respon…
kianbehzad Mar 20, 2019
b2063d5
ai response fully tested :)
kianbehzad Mar 20, 2019
a4806fc
update plans
kianbehzad Mar 20, 2019
40c8396
implement service protocol for client communication in server
kianbehzad Mar 20, 2019
af4c42b
[fixBug] all active and master properties were reset every time a cha…
kianbehzad Mar 20, 2019
337f76f
GK rebase finished but it has a few bugs
Lhumd Mar 20, 2019
dcca907
concidering active and master properties in ai requests(server)
kianbehzad Mar 21, 2019
e5aafa5
send server informations on playoff_client topic
kianbehzad Mar 21, 2019
01c1cde
baby steps of making the Client GUI
kianbehzad Mar 21, 2019
7d38d04
create planLabel Graphic
kianbehzad Mar 22, 2019
0a819d4
implement service call for each planLabel
kianbehzad Mar 22, 2019
93a785d
add plansView Widget
kianbehzad Mar 22, 2019
d7fee7a
create a base view for playoffwidget
kianbehzad Mar 23, 2019
6d4cf8f
wow it works, only some graphical changes left
kianbehzad Mar 23, 2019
9adb603
server only sends the local path from plans directory instead of the …
kianbehzad Mar 23, 2019
fae9118
change ballBesidePoles
Lhumd Mar 25, 2019
d738c42
Merge branch 'develop' of https://github.com/ParsianRoboticLab/ssl in…
Lhumd Mar 25, 2019
d0d3c8a
[fixBug] check if the json plan have all desired values before adding…
kianbehzad Mar 25, 2019
aa9fe46
[NotRelevent] fix 2 issues in game controller node(set config server …
kianbehzad Mar 25, 2019
ee1a0dd
[fixSegment] when ai starts in ForceStart state
kianbehzad Mar 25, 2019
c11dd65
fix bug in GK stopmode
Lhumd Mar 26, 2019
e6f9635
fix GKTSMode but transientFlag doesn't work fine
Lhumd Mar 27, 2019
316ea79
before rebase with NonStop_segment
Lhumd Mar 27, 2019
a252115
fix ourBallPlacement bug
Lhumd Mar 27, 2019
889f8a4
Merge branch 'NonStop_segment' of https://github.com/ParsianRoboticLa…
Lhumd Mar 27, 2019
348133b
error of golie fixed
Lhumd Mar 27, 2019
232758e
Merge branch 'develop' of https://github.com/ParsianRoboticLab/ssl in…
Lhumd Mar 27, 2019
4cca17d
Add test_polygon_2d.cpp
r-mohajer Mar 27, 2019
c70c3a9
Merge branch 'defense' of https://github.com/ParsianRoboticLab/ssl in…
Lhumd Mar 27, 2019
b06913f
Add matrix_2d test
r-mohajer Mar 28, 2019
1506c9c
Add rect_2d test
r-mohajer Mar 28, 2019
ed3d4e5
Add segment_2d test
r-mohajer Mar 28, 2019
276b65e
triangle_2d test
r-mohajer Mar 28, 2019
15a319c
Add vector_2d test
r-mohajer Mar 28, 2019
1087662
Add voronoi_diagram test
r-mohajer Mar 28, 2019
6da0b04
Add angle_deg test
r-mohajer Mar 28, 2019
185d23f
Add test to CMakeLists
r-mohajer Mar 28, 2019
3b8cf39
Change polygon_2d tests
r-mohajer Mar 28, 2019
c488a58
Evaluate khafan in dynamicplayoff
maralmd78 Mar 29, 2019
9aedde2
before merge with develop
Lhumd Mar 29, 2019
842a38c
Merge branch 'develop' into defense
Lhumd Mar 29, 2019
60408f2
Solve duplicate code
Lhumd Mar 29, 2019
a255da2
Merge branch 'PlanClient' of https://github.com/ParsianRoboticLab/ssl…
mahi97 Mar 29, 2019
80f1ca8
add planFailed properties too config
kianbehzad Mar 29, 2019
fd8c6ab
Change polygon_2d tests
r-mohajer Mar 29, 2019
097f6aa
Set position for khafan in dynamic playoff
maralmd78 Mar 29, 2019
c30c763
Fix strictfollow
Lhumd Mar 30, 2019
edbb9b0
Delete useless variables
Lhumd Mar 30, 2019
dd4aa36
Fix segmentation fault
Lhumd Mar 30, 2019
ca84e37
hot fix
aligavahi Mar 30, 2019
e0eecfd
fix isBalldirChanged condition bug
kianbehzad Mar 30, 2019
5aff7fd
refine planfailed defualt parameters and setAgentID for RoleAgents
kianbehzad Mar 30, 2019
1369f5a
remove kianplan from ignore files
kianbehzad Mar 30, 2019
b4f9cf8
Merge pull request #95 from ParsianRoboticLab/defense
Lhumd Mar 30, 2019
2289f64
Merge branch 'develop' into GKSegment
Lhumd Mar 30, 2019
42ebe8c
remove return 1 :/
kianbehzad Mar 30, 2019
cf8b3fb
Add a config file
r-mohajer Mar 30, 2019
8a09000
Change tests from cppunit to gtest
r-mohajer Mar 30, 2019
fe96784
Change include of voronoi
r-mohajer Mar 30, 2019
bc17899
Add two function to segment_2d class
r-mohajer Mar 30, 2019
0520d34
replace ourplayoffkick condition in decideprefereddefence
kianbehzad Mar 30, 2019
d2ab6e3
fix bug in Dynamicplayoff
mahi97 Mar 30, 2019
07a3ca4
change author
maralmd78 Mar 30, 2019
0369b98
Merge branch 'DynamicPlayOff' of https://github.com/ParsianRoboticLab…
mahi97 Mar 30, 2019
f34082a
add using khafan to config
maralmd78 Mar 30, 2019
a4ad132
Fix conflict
maralmd78 Mar 30, 2019
f819246
Timeneeded is in knowledge
Lhumd Mar 30, 2019
683554d
Merge pull request #100 from ParsianRoboticLab/GKSegment
Lhumd Mar 30, 2019
69908a2
Chage state in dynamicplayoff
maralmd78 Mar 30, 2019
e9e73ee
Merge branch 'develop' into just_shot_no_pass
Lhumd Mar 30, 2019
ffe2e3e
fix conflicts with develop
kianbehzad Mar 30, 2019
3dd1f16
Merge pull request #102 from ParsianRoboticLab/just_shot_no_pass
Lhumd Mar 30, 2019
3463d5d
Merge branch 'develop' into PlanClient
Lhumd Mar 30, 2019
4174047
Merge pull request #105 from ParsianRoboticLab/PlanClient
Lhumd Mar 30, 2019
df58c96
Complete geom tests
r-mohajer Mar 31, 2019
8478651
Fix a bug in getBoundingBox function
r-mohajer Mar 31, 2019
6937b24
Add CMakeLists.txt
r-mohajer Mar 31, 2019
abe137a
Merge branch 'develop' of github.com:ParsianRoboticLab/ssl into unittest
r-mohajer Mar 31, 2019
1974014
Merge branch 'develop' into NonStop_segment
kianbehzad Mar 31, 2019
5e8e4d2
Merge pull request #108 from ParsianRoboticLab/NonStop_segment
Lhumd Mar 31, 2019
b5b87c7
Use khafan config fix bug
maralmd78 Mar 31, 2019
963b325
Merge branch 'develop' of https://github.com/ParsianRoboticLab/ssl in…
maralmd78 Mar 31, 2019
d688c1e
Solve a porblem in dynamicplayoff
maralmd78 Apr 1, 2019
2e9dc6c
amir bayat new branch- everything fine except posclean
amirbayat98 Mar 29, 2019
9cb7ef5
amir done just postion khali nadarim monde
amirbayat98 Mar 31, 2019
c369b48
everything ready for positioning
amirbayat98 Mar 31, 2019
2303b7e
onetouch and chip or pass done. chip or pass havent sent to play make…
amirbayat98 Mar 31, 2019
224e5f3
onetouch declared
amirbayat98 Mar 31, 2019
1e46967
resolved files from commit -> force start bug fixed
amirbayat98 Apr 1, 2019
e40d969
Merge branch 'develop' into unittest
mahi97 Apr 2, 2019
370f0f4
Merge pull request #112 from ParsianRoboticLab/unittest
Lhumd Apr 2, 2019
59c8dd1
fix complex method problem
aligavahi Apr 3, 2019
e99bf05
a little bit better code. added passPoint and passDecision. passDecis…
amirbayat98 Apr 3, 2019
2a13e06
fix parsian util cmake for teste
kianbehzad Apr 3, 2019
28e7220
Merge pull request #116 from ParsianRoboticLab/fix_test
Lhumd Apr 3, 2019
c2e8d8f
pass REciver id found
amirbayat98 Apr 3, 2019
2defd18
pass reciever stays. and region containing passreviever is out of pri…
amirbayat98 Apr 3, 2019
a45e593
done fixing codefactor thins
amirbayat98 Apr 3, 2019
0768976
Merge branch 'develop' into amirbayat
Lhumd Apr 3, 2019
0f409e9
Merge pull request #120 from ParsianRoboticLab/amirbayat
Lhumd Apr 3, 2019
b2d255b
remove validate point in direct mode
rebinnaf Apr 4, 2019
ff694c0
Update kick.cpp
Lhumd Apr 4, 2019
b39679d
Merge pull request #123 from ParsianRoboticLab/fix_kick_skill
Lhumd Apr 4, 2019
dacc6d9
Merge pull request #122 from ParsianRoboticLab/DynamicPlayOff
Lhumd Apr 4, 2019
9a56e8d
Create config.yml
mahi97 Apr 11, 2019
a65dc56
Merge pull request #125 from ParsianRoboticLab/mahi97-patch-1
mahi97 Apr 11, 2019
e3e2586
Update planner.h
mahi97 Apr 11, 2019
76e3716
Merge pull request #127 from ParsianRoboticLab/mahi97-patch-1
mahi97 Apr 11, 2019
df191ce
Update config.yml
mahi97 Apr 11, 2019
3b182cf
Create stale.yml
mahi97 Apr 11, 2019
b58ba53
Add .circleci/config.yml
mahi97 Jun 30, 2021
638b4e0
Update README.md
mahi97 Jun 30, 2021
dc9b799
Initial plan
Copilot Mar 16, 2026
905a180
Fix gotopointavoid skill: velmax, ourrelax/theirrelax, and action tem…
Copilot Mar 16, 2026
3f12069
Potential fix for pull request finding
mahi97 Mar 16, 2026
c60005f
Merge pull request #133 from ParsianRoboticLab/copilot/add-gotopointa…
mahi97 Mar 16, 2026
5108896
docs: complete README professionally
Copilot Apr 9, 2026
912f38d
Merge pull request #134 from ParsianRoboticLab/copilot/complete-readm…
mahi97 Apr 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# These are the available config settings.
keyword: ["@todo", "TODO:", "TODO", "TO DO"] # string|string[]
bodyKeyword: ["@body", "BODY", "BODY:"] # string|string[]
blobLines: 5 # number|boolean, 0 or false to disable
autoAssign: true # string|string[]|boolean
label: true # boolean|string|string[]
reopenClosed: true # boolean
caseSensitive: false
17 changes: 17 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- no_stale
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
146 changes: 142 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,147 @@
## Parsian SSL
[![CircleCI](https://circleci.com/gh/ParsianRoboticLab/ssl/tree/develop.svg?style=svg)](https://circleci.com/gh/ParsianRoboticLab/ssl/tree/develop)
[![CodeFactor](https://www.codefactor.io/repository/github/parsianroboticlab/ssl/badge/develop)](https://www.codefactor.io/repository/github/parsianroboticlab/ssl/overview/develop)
# Parsian SSL

# Install Stuff
[![CircleCI](https://circleci.com/gh/ParsianRoboticLab/ssl/tree/develop.svg?style=svg)](https://circleci.com/gh/ParsianRoboticLab/ssl/tree/develop)
[![CodeFactor](https://www.codefactor.io/repository/github/parsianroboticlab/ssl/badge?s=ae124388adc531f2cb4c8fc1621e1f251f0c9747)](https://www.codefactor.io/repository/github/parsianroboticlab/ssl)
[![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0)

The **Parsian SSL** stack is the full software framework used by [Parsian Robotic Lab](https://github.com/ParsianRoboticLab) to compete in the [RoboCup Small Size League (SSL)](https://ssl.robocup.org/). It is built on top of [ROS](https://www.ros.org/) and provides a complete pipeline from raw vision and referee data all the way down to individual robot motion commands.

---

## Table of Contents

- [Architecture](#architecture)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Building](#building)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)
- [Acknowledgements](#acknowledgements)

---

## Architecture

The stack is organized as a collection of ROS packages, each responsible for a distinct layer of the pipeline:

```
SSL Vision / Referee / grSim
parsian_protobuf_wrapper ← decodes UDP protobuf packets into ROS messages
parsian_world_model ← sensor fusion & Kalman filtering → world model
parsian_ai ← multi-agent behavioral AI & play execution
parsian_agent ← per-robot path planning & motion control
parsian_communication ← serializes commands & sends to robots via radio
```

| Package | Description |
|---|---|
| [`parsian_protobuf_wrapper`](parsian_protobuf_wrapper/) | Wraps SSL Vision, grSim, and SSL Referee protobuf UDP streams into ROS topics |
| [`parsian_world_model`](parsian_world_model/) | Reads vision data, runs a Kalman-filter based tracker, and publishes a fused world-model |
| [`parsian_ai`](parsian_ai/) | Behavioral AI layer: evaluates game state, selects plays, and assigns per-robot tasks |
| [`parsian_agent`](parsian_agent/) | Per-robot node: consumes task messages and produces low-level motion commands via path planning |
| [`parsian_communication`](parsian_communication/) | Encodes robot commands into binary packets and transmits them over a serial/radio link |
| [`parsian_msgs`](parsian_msgs/) | Shared ROS message and service definitions used across all packages |
| [`parsian_util`](parsian_util/) | Shared utility library: geometry primitives, action helpers, and math utilities |
| [`parsian_tools`](parsian_tools/) | Miscellaneous tooling and helper nodes |
| [`rqt_parsian_gui`](rqt_parsian_gui/) | rqt-based graphical monitor and operator interface |

---

## Prerequisites

- **OS**: Ubuntu 16.04 (Xenial) or later
- **ROS**: [ROS Kinetic](http://wiki.ros.org/kinetic/Installation) (or a compatible distro)
- **Build tools**: `catkin_tools` (`catkin build`)
- **System libraries**:
- `libqt4-dev`, `libqjson-dev`
- `protobuf-compiler`, `libprotobuf-dev`
- `libeigen3-dev`
- `curl`
- **ROS packages**: `dynamic-reconfigure`, `nodelet`, `roslint`, `rqt-gui-cpp`, `rqt-gui`

---

## Installation

A bootstrapping script handles cloning all required repositories and installing dependencies:

```bash
sh -c "$(curl -fsSL https://gist.githubusercontent.com/mahi97/60295c82e21215701d42d4c1e679ac1f/raw/66662032274aa55888099138884748cd2a47f092/install.sh clone)"
```

> **Note:** Review the script before running it. It will clone this repository into a catkin workspace and install the necessary system and ROS dependencies.

---

## Building

After installation, build the entire workspace with:

```bash
cd ~/catkin_ws # or wherever the workspace was created
catkin build
source devel/setup.bash
```

---

## Usage

Launch the full stack (vision receiver → world model → AI → agent → communication):

```bash
# Start the protobuf wrappers (SSL Vision, Referee, grSim)
roslaunch parsian_protobuf_wrapper protos.launch

# Start the world model
roslaunch parsian_world_model parsian_world_model.launch

# Start the AI
roslaunch parsian_ai ai.launch

# Open the operator GUI
rqt --perspective-file $(rospack find rqt_parsian_gui)/perspectives/Main.perspective
```

For simulation with **grSim**, make sure grSim is running and listening on the default ports before launching the wrappers.

---

## Contributing

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on naming conventions, coding style, and how to submit changes.

---

## License

This project is licensed under the **GNU Lesser General Public License v3.0**. See [LICENSE](LICENSE) for the full text.

---

## Acknowledgements

Parsian SSL is built and maintained by the Parsian Robotic Lab team at Amirkabir University of Technology (Tehran Polytechnic). Core contributors include:

- Mohammad Mahdi Rahimi
- Ali Gavahi
- Mohammad Mahdi Shirazi
- Kian Behzad
- Hamidreza Roodabeh
- Fateme Hashemi
- Nadia Moradi

See [CHANGELOG](CHANGELOG) for a full history of contributions.


2 changes: 0 additions & 2 deletions parsian_agent/include/parsian_agent/kick.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ enum class KMode {
DONTKICK = 4,
JTurn = 5,
TurnForKick = 6


};

class CSkillKick : public CSkill, public KickAction {
Expand Down
4 changes: 2 additions & 2 deletions parsian_agent/include/planner/planner.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <QMetaType>
#include <parsian_msgs/parsian_path.h>
#include <parsian_util/core/field.h>
#include "parsian_util/tools/drawer.h" //TODO must be new in node
#include "parsian_util/tools/drawer.h" // TODO must be new in node
#include "parsian_util/tools/blackboard.h"
#include "parsian_util/core/agent.h"
#include "parsian_util/geom/geom.h"
Expand All @@ -21,7 +21,7 @@
#define _PLANNER_EXTEND_POINT_LIMIT 150
#define _PLANNER_EXTEND_MAX_ATTEMPT 200

#define _MAX_NUM_PLAYERS 12 //TODO must be get from somewhere else
#define _MAX_NUM_PLAYERS 12 // TODO must be get from somewhere else



Expand Down
86 changes: 58 additions & 28 deletions parsian_agent/src/auto_decider/auto_decider_nodelet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,74 +5,104 @@
#include <parsian_msgs/parsian_robot.h>
#include <parsian_msgs/parsian_world_model.h>
#include <parsian_util/geom/vector_2d.h>
#include <parsian_msgs/parsian_robot_fault.h>
#include <parsian_msgs/parsian_robots_fault.h>
#include <parsian_util/tools/blackboard.h>
#include <QList>
#include <QTime>

using namespace rcsc;
# define buffer_size 200
# define threshold 0.25
#define _MAX_NUM_PLAYERS 12
#define status_timeout 10000

// about this node
//this node detects robots faults based on wm and robot_status data,
//and publishes the result on /autofualt topic
//the result contains a list of robot_fualt message for all robots
//if the robots dont send their status for more than 'status_timeout' ms
//the node decides to not to detect faults for any robots

//TODOS
//1)select what state the damaged robot is
//2)what kick(or what ever)fault = true means (dameged or not)
//3)whats the best number f0or threshold and buffersize

namespace auto_decider {

struct RobotInfo{
parsian_msgs::parsian_robot_status status;
bool ballIsNear;
QList<bool> fault;
};

class Decider : public nodelet::Nodelet {
public:
parsian_msgs::parsian_robot_faultPtr res;
parsian_msgs::parsian_robots_faultPtr robotsFault;
ros::Publisher pub;
ros::Subscriber robo_sub,wm_sub;
bool shootSensors[12];
bool isNear[12];
QList<bool> faults[12];
QList<RobotInfo> robotInfos;
QTime timer;
private:
virtual void onInit() {

ros::NodeHandle &private_nh = getPrivateNodeHandle();
ros::NodeHandle &nh = getNodeHandle();
pub = private_nh.advertise<parsian_msgs::parsian_robot_fault>("/autofault", 5);
pub = private_nh.advertise<parsian_msgs::parsian_robots_fault>("/autofault", 5);
robo_sub = nh.subscribe("/robots_status", 100, &Decider::statusCb, this);
wm_sub = nh.subscribe("/world_model", 100, &Decider::wmCb, this);
for(int i{}; i < _MAX_NUM_PLAYERS; i++)
{
RobotInfo tmp;
robotInfos.push_back(tmp);
}
}

void statusCb(const parsian_msgs::parsian_robots_status msg) {
for (int i = 0; i < 12; i++)
shootSensors[i] = msg.status[i].shootSensor;
timer.start();
for(int i{}; i < robotInfos.size(); i++)
{
robotInfos[i].status = parsian_msgs::parsian_robot_status();
robotInfos[i].status.id = i;
}
for (auto stat: msg.status)
robotInfos[stat.id].status = stat;
}

void wmCb(const parsian_msgs::parsian_world_model msg) {
for (int i = 0; i < 12; i++)
isNear[i] = Vector2D(msg.our[i].pos).dist(msg.ball.pos) < threshold;
for (auto robotinfo: robotInfos)
robotinfo.ballIsNear = Vector2D(msg.our[robotinfo.status.id].pos).dist(msg.ball.pos) < threshold;
faultdetect();
}

void faultdetect() {
robotsFault.reset(new parsian_msgs::parsian_robots_fault);
for (int i = 0; i < robotInfos.size(); i++){
parsian_msgs::parsian_robot_faultPtr tmp;
tmp.reset(new parsian_msgs::parsian_robot_fault);
robotsFault->robots.push_back(*tmp);
}

for (auto robotinfo: robotInfos) {
parsian_msgs::parsian_robot_faultPtr tmp;
tmp.reset(new parsian_msgs::parsian_robot_fault);
tmp->robot_id = robotinfo.status.id;
robotinfo.fault.append(!robotinfo.ballIsNear && robotinfo.status.shootSensor);

for (int i = 0; i < 12; i++) {
res.reset(new parsian_msgs::parsian_robot_fault);
res->robot_id=i;
faults[i].append(!isNear[i] && shootSensors[i]);

if (faults[i].size() > buffer_size)
faults[i].removeFirst();
if (robotinfo.fault.size() > buffer_size)
robotinfo.fault.removeFirst();

int sum = 0;
for (auto fault : faults[i])
for (auto fault : robotinfo.fault)
sum+= fault;


if(sum > faults[i].size() * .7)
res->select = 2;
if(sum > robotinfo.fault.size() * .7 && timer.elapsed() < status_timeout)
tmp->select = 2;
else
res->select = 0;
tmp->select = 0;

PDEBUG(QString("faults %1 = ").arg(i).toStdString(),sum,D_ALI);
PDEBUG(QString("select %2 = ").arg(i).toStdString(),res->select,D_ALI);
pub.publish(res);
//PDEBUG(QString("faults %1 = ").arg(i).toStdString(),sum,D_ALI);
//PDEBUG(QString("select %2 = ").arg(i).toStdString(),tmp->select,D_ALI);
robotsFault->robots[tmp->robot_id] = *tmp;
}
pub.publish(robotsFault);
}

};
Expand Down
Binary file added parsian_agent/src/parsian_agent/.kick.cpp.swp
Binary file not shown.
21 changes: 18 additions & 3 deletions parsian_agent/src/parsian_agent/gotopointavoid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@ void CSkillGotoPointAvoid::execute() {
bangBang->setDecMax(conf->DecMax);
bangBang->setOneTouch(oneTouchMode);
bangBang->setDiveMode(diveMode);
double effectiveVelMax = conf->VelMax;
if (maxVelocity > 0.0f) {
effectiveVelMax = min(effectiveVelMax, static_cast<double>(maxVelocity));
}
if (slowMode) {
bangBang->setVelMax(1.4);
bangBang->setSlow(true);
} else {
bangBang->setSlow(false);
bangBang->setVelMax(conf->VelMax);
bangBang->setVelMax(effectiveVelMax);
}

if (!Vector2D(targetPos).valid()) {
Expand Down Expand Up @@ -89,9 +93,20 @@ void CSkillGotoPointAvoid::execute() {
if (!noAvoid) {

/*********** PLANNER ***************/
ourRelaxList.clear();
for (auto id : ourrelax) {
ourRelaxList.append(static_cast<int>(id));
}
oppRelaxList.clear();
for (auto id : theirrelax) {
oppRelaxList.append(static_cast<int>(id));
}
agent->initPlanner(targetPos , ourRelaxList , oppRelaxList , avoidPenaltyArea , avoidCenterCircle , ballObstacleRadius);
for (long i = agent->pathPlannerResult.size() - 1 ; i >= 0 ; i--) {
result.append(agent->pathPlannerResult[i]);
auto plannerSize = agent->pathPlannerResult.size();
if (plannerSize > 0) {
for (long i = static_cast<long>(plannerSize) - 1; i >= 0; --i) {
result.append(agent->pathPlannerResult[static_cast<std::size_t>(i)]);
}
}
}

Expand Down
Loading