Commit 883b46fd authored by Arnaud Blanchard's avatar Arnaud Blanchard

Merge branch 'master' of https://promethe.u-cergy.fr/blaar/blaar

parents a33a0f87 814f8662
[submodule "blibs/blc_core"]
path = blibs/blc_core
url = https://framagit.org/blibs/blc_core.git
[submodule "blibs/blc_channel"]
path = blibs/blc_channel
url = https://framagit.org/blibs/blc_channel.git
[submodule "blibs/blc_network"]
path = blibs/blc_network
url = https://framagit.org/blibs/blc_network.git
[submodule "blibs/blc_program"]
path = blibs/blc_program
url = https://framagit.org/blibs/blc_program.git
[submodule "blibs/blc_process"]
path = blibs/blc_process
url = https://framagit.org/blibs/blc_process.git
[submodule "blibs/blc_image"]
path = blibs/blc_image
url = https://framagit.org/blibs/blc_image.git
[submodule "bapps"]
path = bapps
url = https://framagit.org/blaar/bapps.git
[submodule "gnuplot"]
path = gnuplot
url = https://framagit.org/blaar/gnuplot.git
[submodule "fftw"]
path = fftw
url = https://framagit.org/blaar/fftw.git
[submodule "sndfile"]
path = sndfile
url = https://framagit.org/blaar/sndfile.git
[submodule "png"]
path = png
url = https://framagit.org/blaar/png.git
[submodule "gtk"]
path = gtk
url = https://framagit.org/blaar/gtk.git
......@@ -11,11 +11,11 @@ Note that git pull merge from he repository branch
Conflicts:
----------
You can use **meld** to have a graphical interface to select the differences.
You want to get only their modifications: `git checkout --theirs <files>`
You can use **meld** to have a graphical interface to select the differences.
You want to get only yours modifications: ` git checkout --ours <files>`
- You want to get only their modifications: `git checkout --theirs <files>`
- You want to get only yours modifications: ` git checkout --ours <files>`
Then `git add <files>`to say you fix the conflict.
......@@ -25,8 +25,10 @@ Remove a specific commits: `git revert <commit id>`
Submodule
=========
Completly remove a submodule
Remove
------
git submodule deinit -f -- <submodule>
rm -rf .git/modules/<submodule>
git rm -f <submodule>
1. git submodule deinit -f -- a/submodule
2. rm -rf .git/modules/a/submodule
3. git rm -f a/submodule
armadillo @ ff259b5a
Subproject commit ff259b5a4ac1bc2ea30a4018c8ba84744fedbf35
#ifdef __APPLE__
#include <OpenGL/gl3.h>
#else
#include <GL/glew.h>
#endif
#include "blc_core.h"
#include "blgl_viewer.h"
int *shaders_ids=NULL;
int shaders_nb=0;
//shader_type=GL_VERTEX_SHADER|GL_FRAGMENT_SHADER
GLuint blgl_create_shader(char const *source, GLenum shader_type){
char *log_buffer;
GLuint shader_id;
shader_id = glCreateShader(shader_type);
GLint result, log_length;
glShaderSource(shader_id, 1, &source , NULL);
glCompileShader(shader_id);
APPEND_ITEM(&shaders_ids, &shaders_nb, &shader_id);
// Check Vertex Shader
glGetShaderiv(shader_id, GL_COMPILE_STATUS, &result);
glGetShaderiv(shader_id, GL_INFO_LOG_LENGTH, &log_length);
if ( log_length){
log_buffer=MANY_ALLOCATIONS(log_length+1, char);
glGetShaderInfoLog(shader_id, log_length, NULL, log_buffer);
fprintf(stderr, "%s\n", log_buffer);
FREE(log_buffer);
}
if (result==GL_FALSE) EXIT_ON_ERROR("Compiling shader '%s'.", source);
return shader_id;
}
/* You need to create the shader ( blgl_create_shader ) before */
GLint blgl_create_program(){
char *log_buffer;
GLint result, log_length, program_id;
int i;
if (shaders_nb==0) EXIT_ON_ERROR("You need to create at least a shader before");
program_id = glCreateProgram();
FOR(i, shaders_nb){
glAttachShader(program_id, shaders_ids[i]);
}
glLinkProgram(program_id);
// Check the program
glGetProgramiv(program_id, GL_LINK_STATUS, &result);
glGetProgramiv(program_id, GL_INFO_LOG_LENGTH, &log_length);
if (log_length > 0 ){
log_buffer=MANY_ALLOCATIONS(log_length+1, char);
glGetProgramInfoLog(program_id, log_length, NULL, log_buffer);
fprintf(stderr, "%s\n", log_buffer);
FREE(log_buffer);
if (result==0) EXIT_ON_ERROR("Linking GL program");
}
FOR(i, shaders_nb){
glDetachShader(program_id, shaders_ids[i]);
glDeleteShader(shaders_ids[i]);
}
FREE(shaders_ids);
shaders_nb=0;
return program_id;
}
# Copyright ETIS — ENSEA, Université de Cergy-Pontoise, CNRS (2011 - 2018)
# Author: Arnaud Blanchard
# This software is governed by the CeCILL v2.1 license under French law and abiding by the rules of distribution of free software.
# You can use, modify and/ or redistribute the software under the terms of the CeCILL v2.1 license as circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".
# As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
# users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability.
# In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software,
# that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge.
# Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured  and, more generally, to use and operate it in the same conditions as regards security.
# The fact that you are presently reading this means that you have had knowledge of the CeCILL v2.1 license and that you accept its terms.
#Basic Library for robotique simulator with gem
cmake_minimum_required(VERSION 2.6)
project(blglm_simulator)
find_package(blc_core REQUIRED)
find_package(glm REQUIRED)
set(sources blglm_simulator.cpp)
set(DEFINITIONS ${BL_DEFINITIONS})
set(INCLUDES ${BL_INCLUDE_DIRS} ${GLM_INCLUDE_DIRS} include)
set(LIBRARIES ${BL_LIBRARIES})
message(include: ${GLM_INCLUDE_DIRS})
add_definitions(${DEFINITIONS})
include_directories(${INCLUDES})
add_library(blglm_simulator SHARED ${sources})
target_link_libraries(blglm_simulator ${LIBRARIES})
#static_version
add_library(static_blglm_simulator STATIC ${sources})
set_target_properties(static_blglm_simulator PROPERTIES OUTPUT_NAME blglm_simulator)
#Describe what will be to install or in the package
install(DIRECTORY include/ DESTINATION include/blglm_simulator)
install(TARGETS blglm_simulator static_blglm_simulator DESTINATION lib)
install(FILES blglm_simulator-config.cmake DESTINATION share/blglm_simulator)
find_package(blc_core REQUIRED)
find_package(glm REQUIRED)
find_path(BLGLM_SIMULATOR_INCLUDE_DIR blglm_simulator.h PATH_SUFFIXES blglm_simulator)
find_library(BLGLM_SIMULATOR_LIBRARY blglm_simulator)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(blglm_simulator DEFAULT_MSG BLGLM_SIMULATOR_INCLUDE_DIR BLGLM_SIMULATOR_LIBRARY)
#No access outide this file
mark_as_advanced(BLGLM_SIMULATOR_INCLUDE_DIR BLGLM_SIMULATOR_LIBRARY)
list(APPEND BL_INCLUDE_DIRS ${BLGLM_SIMULATOR_INCLUDE_DIR} ${GLM_INCLUDE_DIRS})
list(APPEND BL_LIBRARIES ${BLGLM_SIMULATOR_LIBRARY} ${BL_LIBRARIES})
list(REMOVE_DUPLICATES BL_INCLUDE_DIRS)
list(REMOVE_DUPLICATES BL_LIBRARIES)
//
// opengl.cpp
// tino_viewer
//
// Created by Arnaud Blanchard on 29/11/2017.
//
//
#include "blglm_simulator.h"
#include "blc_core.h" //APPEND_ITEM, FOR, FREE...
#include <glm/glm.hpp>
#include <glm/gtx/euler_angles.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx/quaternion.hpp>
int blglm_simulator_joint::root_joints_nb=0;
blglm_simulator_joint **blglm_simulator_joint::root_joints=NULL;
blglm_simulator_joint::blglm_simulator_joint(blglm_simulator_joint *support, glm::vec3 pos, glm::vec3 axis, float *angle_pt ,float limit_min, float limit_max)
:angle_pt(angle_pt), limit_min(limit_min), limit_max(limit_max), pos(pos), axis(axis), joints(NULL), joints_nb(0){
blglm_simulator_joint *this_joint=this;
if (support) APPEND_ITEM(&support->joints, &support->joints_nb, &this_joint);
else APPEND_ITEM(&root_joints, &root_joints_nb, &this_joint);
}
/*
blgl_joint::blgl_ball_joint(blgl_joint *support, glm::vec3 pos, float *angle_pt ,float limit_min, float limit_max)
:angle_pt(angle_pt), limit_min(limit_min), limit_max(limit_max), pos(pos), joints(NULL), joints_nb(0){
blgl_joint *this_joint=this;
if (support) APPEND_ITEM(&support->joints, &support->joints_nb, &this_joint);
else APPEND_ITEM(&root_joints, &root_joints_nb, &this_joint);
}*/
blglm_simulator_joint::~blglm_simulator_joint(){
int i;
FOR(i, joints_nb) delete joints[i];
FREE(joints);
}
void blglm_simulator_joint::update(glm::mat4 current_model){
float absolute_angle;
glm::quat quaternion; //We need to use quaternion to have local rotation
int i;
if (*angle_pt>1 || *angle_pt<0) EXIT_ON_ERROR("Value of angle '%f' outside the range [0,1]", *angle_pt);
absolute_angle=*angle_pt*(limit_max-limit_min)+limit_min;
current_model = glm::translate(current_model, pos);
quaternion=glm::angleAxis(absolute_angle, axis);
model=current_model*glm::toMat4(quaternion);
FOR(i, joints_nb) joints[i]->update(model);
}
void blglm_simulator_joint::update_all(){
int i;
glm::mat4 identity;
FOR(i, root_joints_nb) root_joints[i]->update(identity);
}
void blglm_simulator_joint::remove_all(){
int i;
FOR(i, root_joints_nb) delete root_joints[i];
FREE(root_joints);
}
#ifndef BLGLM_SIMULATOR_H
#define BLGLM_SIMULATOR_H
#include <glm/glm.hpp>
typedef struct blglm_simulator_joint{
float *angle_pt, limit_min, limit_max;
glm::mat4 model;
glm::vec3 pos, axis;
blglm_simulator_joint **joints;
int joints_nb;
static blglm_simulator_joint **root_joints;
static int root_joints_nb;
blglm_simulator_joint(blglm_simulator_joint *support, glm::vec3 pos, glm::vec3 axis, float *angle_pt, float limit_min=-M_PI, float limit_max=M_PI);
// blgl_ball_joint(blgl_joint *support, glm::vec3 pos, float angles_pt[3], float limit_min=-M_PI, float limit_max=M_PI);
~blglm_simulator_joint();
void update(glm::mat4 model);
static void update_all();
static void remove_all();
}blglm_simulator_joint;
#endif /* _3DMODEL_H */
#Basic Librairies And Applications for Robotics (BLAAR)
#Copyright ETIS — ENSEA, Université de Cergy-Pontoise, CNRS (2015 - 2017)
#This software is governed by the CeCILL v2.1 license under French law and abiding by the rules of distribution of free software.
#You can use, modify and/ or redistribute the software under the terms of the CeCILL v2.1 license as circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".
#As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license, users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability.
#In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software, that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge.
#Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured and, more generally, to use and operate it in the same conditions as regards security.
#The fact that you are presently reading this means that you have had knowledge of the CeCILL v2.1 license and that you accept its terms.
#!/usr/bin/env bash #Use your $PATH to find bash
set -o errexit #Exit on first error
set -o nounset #Error if a variable is used but nont defined
set -o pipefail #Error if a pipe fail
if [ $# -ne 1 ]
then
echo "You need a project directory as argument."
echo "Usage : codeblocks_project <project_directory>"
exit 1
fi
#We go to the project directory and get the directory name then we go back to seach for the baar directory
cd $1
project_dir="$PWD"
project_name=$(basename $project_dir)
cd - >/dev/null #Now we have the project directory we go back in current directory without message (/dev/null)
#We go in blaar directory
cd $(dirname $0)
blaar_dir="$PWD"
blaar_build_dir="${blaar_dir}_build"
developer_tools/create_project.sh $1 $blaar_build_dir codeblocks
open $blaar_build_dir/cmake_files_codeblocks/$project_name/$project_name.cbp
......@@ -16,7 +16,7 @@ set -o pipefail #Error if a pipe fail
if [ $# -ne 3 ]
then
echo "You need 3 arguments but you only have $#"
echo "Usage : create_project.sh <project directory> <build directory> <eclipse|xcode>"
echo "Usage : create_project.sh <project directory> <build directory> <eclipse|xcode|codeblocks>"
exit 1
fi
......@@ -39,7 +39,8 @@ case "$3" in
"eclipse") generator="Eclipse CDT4 - Ninja";;
"xcode") generator="Xcode";;
"sublime") generator="Sublime Text 2 - Ninja";;
"*") echo "The platform can be 'eclipse' or 'xcode', '$3' is unknowned"
"codeblocks") generator="CodeBlocks - Ninja";;
"*") echo "The platform can be 'eclipse', 'xcode', 'sublime' or 'codeblocks', '$3' is unknowned"
exit 1;;
esac
ide_name=$3
......
......@@ -22,7 +22,6 @@ blaar_add_option size s "" "integer" "number of items per buffer" "4096"
blaar_add_option samplerate S "" "integer" "Samplerate of the sound acquisition" "44100"
blaar_parse_args "$@"
[ $filename ] && file_option="--file=$filename" || file_option=""
[ $output ] && output_option="--output=$output"|| output_option=""
if [ $filename ]; then
......
......@@ -24,21 +24,20 @@ blaar_add_option device D "" "device_name" "device to use for the speaker"
blaar_add_option filename f "" "filename" "file to save the sound to"
blaar_add_option size s "" "integer" "number of items per buffer" "4096"
blaar_add_option samplerate S "" "integer" "samplerate of the sound export" "44100"
blaar_add_parameter sound "blc_channel-in" 1 "sound to diffuse"
blaar_add_parameter sound "blc_channel-in" "1" "sound to diffuse"
blaar_parse_args "$@"
[ $filename ] && file_option="-f=$filename" || file_option=""
if [ $filename ]; then
echo "to '$filename'" >&2
[ $device ] && { echo "You cannot have file (-f $filename) and speaker (-D $device) at the same time"; exit 1; }
blaar_module sndfile o_sndfile --file=$filename --size=$size --samplerate=$samplerate $sound
o_sndfile --file=$filename --size=$size --samplerate=$samplerate $sound
elif [ $(uname) = "Darwin" ]; then #microphone
echo "to coreaudio speaker" >&2
blaar_module coreaudio o_coreaudio
o_coreaudio $sound
elif [ $(uname) = "Linux" ]; then
echo "to ALSA speaker" >&2
blaar_module asound o_asound
o_asound $sound
else
echo "$blaar_program_name does not work on '$(uname)' platform"
exit 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment