Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/ab3nd/TinyRobo
- Loading branch information
Showing
15 changed files
with
647 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
cmake_minimum_required(VERSION 2.8.12) | ||
project(argos_tinyrobo) | ||
|
||
# Deactivate RPATH for MacOSX | ||
set(CMAKE_MACOSX_RPATH 0) | ||
|
||
# Set the path where CMake will find additional scripts | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) | ||
|
||
# Find the ARGoS package, make sure to save the ARGoS prefix | ||
find_package(PkgConfig) | ||
pkg_check_modules(ARGOS REQUIRED argos3_simulator) | ||
set(ARGOS_PREFIX ${ARGOS_PREFIX} CACHE INTERNAL "") | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ARGOS_PREFIX}/share/argos3/cmake) | ||
|
||
# Check whether all the necessary libs have been installed to compile the | ||
# code that depends on Qt and OpenGL | ||
include(ARGoSCheckQTOpenGL) | ||
|
||
# Look for the (optional) galib library | ||
#find_package(GALIB) | ||
#if(GALIB_FOUND) | ||
# include_directories(${GALIB_INCLUDE_DIRS}) | ||
#endif(GALIB_FOUND) | ||
|
||
# Find Lua | ||
find_package(Lua52 REQUIRED) | ||
|
||
# Set ARGoS include dir | ||
include_directories(${CMAKE_SOURCE_DIR} ${ARGOS_INCLUDE_DIRS} ${LUA_INCLUDE_DIR}) | ||
|
||
# Set ARGoS link dir | ||
link_directories(${ARGOS_LIBRARY_DIRS}) | ||
|
||
# Descend into the controllers directory | ||
#add_subdirectory(controllers) | ||
|
||
# Descend into the loop_functions directory | ||
#add_subdirectory(loop_functions) | ||
|
||
# Descend into the embedding directory | ||
#add_subdirectory(embedding) |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
#This is just the sample gradient buzz script from the wiki | ||
|
||
function init() { | ||
if(id == 0) { | ||
# Source robot | ||
mydist = 0. | ||
} | ||
else { | ||
# Other robots | ||
mydist = 1000 | ||
# Listen to other robots' distances | ||
neighbors.listen("dist_to_source", | ||
function(value_id, value, robot_id) { | ||
mydist = math.min( | ||
mydist, | ||
neighbors.get(robot_id).distance + value) | ||
debug("mydist = ", mydist) | ||
}) | ||
} | ||
} | ||
|
||
function step() { | ||
neighbors.broadcast("dist_to_source", mydist) | ||
debug("d=", mydist) | ||
} | ||
|
||
function destroy() { | ||
} | ||
|
Binary file not shown.
Oops, something went wrong.