Commit d4b0ab4b authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

new release

parent a4f715c1
stages:
- license
- build_and_test
- demos
############ YAML ANCHORS ############
.preliminaries_template: &preliminaries_definition
## Install ssh-agent if not already installed, it is required by Docker.
## (change apt-get to yum if you use an RPM-based image)
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
## Run ssh-agent (inside the build environment)
- eval $(ssh-agent -s)
## Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
## We're using tr to fix line endings which makes ed25519 keys work
## without extra base64 encoding.
## https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
# - echo "$SSH_KNOWN_HOSTS" > $HOME/.ssh/known_hosts
- ssh-keyscan -H -p 2202 gitlab.iri.upc.edu >> $HOME/.ssh/known_hosts
# update apt
- apt-get update
# create ci_deps folder (if not exists)
- mkdir -pv ci_deps
# manually source ros setup.bash
- source /root/catkin_ws/devel/setup.bash
- roscd # check that it works
.license_header_template: &license_header_definition
- cd $CI_PROJECT_DIR
# configure git
- export CI_NEW_BRANCH=ci_processing$RANDOM
- echo creating new temporary branch... $CI_NEW_BRANCH
- git config --global user.email "${CI_EMAIL}"
- git config --global user.name "${CI_USERNAME}"
- git checkout -b $CI_NEW_BRANCH # temporary branch
# license headers
- export CURRENT_YEAR=$( date +'%Y' )
- echo "current year:" ${CURRENT_YEAR}
- if [ -f license_header_${CURRENT_YEAR}.txt ]; then
# add license headers to new files
- echo "File license_header_${CURRENT_YEAR}.txt already exists. License headers are assumed to be updated. Adding headers to new files..."
- ./ci_deps/wolf/wolf_scripts/license_manager.sh --add --path=. --license-header=license_header_${CURRENT_YEAR}.txt --exclude=ci_deps
- else
# update license headers of all files
- export PREV_YEAR=$(( CURRENT_YEAR-1 ))
- echo "Creating new file license_header_${CURRENT_YEAR}.txt..."
- git mv license_header_${PREV_YEAR}.txt license_header_${CURRENT_YEAR}.txt
- sed -i "s/${PREV_YEAR}/${PREV_YEAR},${CURRENT_YEAR}/g" license_header_${CURRENT_YEAR}.txt
- ./ci_deps/wolf/wolf_scripts/license_manager.sh --update --path=. --license-header=license_header_${CURRENT_YEAR}.txt --exclude=ci_deps
- fi
# push changes (if any)
- if git commit -a -m "[skip ci] license headers added or modified" ; then
- git remote set-url --push origin "ssh://git@gitlab.iri.upc.edu:2202/${CI_PROJECT_PATH}.git"
- git push origin $CI_NEW_BRANCH:${CI_COMMIT_REF_NAME}
- else
- echo "No changes, nothing to commit!"
- fi
.install_wolf_template: &install_wolf_definition
- cd ${CI_PROJECT_DIR}/ci_deps
- if [ -d wolf ]; then
- echo "directory wolf exists"
- cd wolf
- git checkout devel
- git pull
- git checkout $WOLF_CORE_BRANCH
- git pull
- else
- git clone -b $WOLF_CORE_BRANCH ssh://git@gitlab.iri.upc.edu:2202/mobile_robotics/wolf_projects/wolf_lib/wolf.git
- cd wolf
- fi
- mkdir -pv build
- cd build
- cmake -DCMAKE_BUILD_TYPE=release -DBUILD_DEMOS=OFF -DBUILD_TESTS=OFF ..
- make -j$(nproc)
- make install
.install_gnssutils_template: &install_gnssutils_definition
- cd ${CI_PROJECT_DIR}/ci_deps
- if [ -d gnss_utils ]; then
- echo "directory gnss_utils exists"
- cd gnss_utils
- git pull
- else
- git clone ssh://git@gitlab.iri.upc.edu:2202/mobile_robotics/gauss_project/gnss_utils.git
- cd gnss_utils
- git submodule update --init
- fi
- mkdir -pv build
- cd build
- cmake -DCMAKE_BUILD_TYPE=release -DBUILD_TESTS=OFF ..
- make -j$(nproc)
- make install
.install_wolfgnss_template: &install_wolfgnss_definition
- cd ${CI_PROJECT_DIR}/ci_deps
- if [ -d gnss ]; then
- echo "directory gnss exists"
- cd gnss
- git checkout devel
- git pull
- git checkout $WOLF_GNSS_BRANCH
- git pull
- else
- git clone -b $WOLF_GNSS_BRANCH ssh://git@gitlab.iri.upc.edu:2202/mobile_robotics/wolf_projects/wolf_lib/plugins/gnss.git
- cd gnss
- fi
- mkdir -pv build
- cd build
- cmake -DCMAKE_BUILD_TYPE=release -DBUILD_TESTS=OFF ..
- make -j$(nproc)
- make install
.clone_wolfrosnode_template: &clone_wolfrosnode_definition
- roscd
- cd ../src
- git clone ssh://git@gitlab.iri.upc.edu:2202/mobile_robotics/wolf_projects/wolf_ros/wolf_ros_node.git
- cd wolf_ros_node
- git checkout $WOLF_ROS_CORE_BRANCH
.build_and_test_template: &build_and_test_definition
- roscd
- cd ../src
- git clone ssh://git@gitlab.iri.upc.edu:2202/${CI_PROJECT_PATH}.git
- cd wolf_ros_gnss
- git checkout $CI_COMMIT_BRANCH
- cd ../..
- catkin_make
############ LICENSE HEADERS ############
license_headers:
stage: license
image: labrobotica/wolf_deps_ros:20.04
cache: []
before_script:
- *preliminaries_definition
- *install_wolf_definition
script:
- *license_header_definition
############ UBUNTU 18.04 TEST ############
build_and_test:bionic:
stage: build_and_test
image: labrobotica/wolf_deps_ros:18.04
cache:
- key: wolf-bionic
paths:
- ci_deps/wolf/
- key: gnssutils-bionic
paths:
- ci_deps/gnss_utils/
- key: gnss-bionic
paths:
- ci_deps/gnss/
before_script:
- *preliminaries_definition
- *install_wolf_definition
- *install_gnssutils_definition
- *install_wolfgnss_definition
- *clone_wolfrosnode_definition
- ldconfig
script:
- *build_and_test_definition
############ UBUNTU 20.04 TEST ############
build_and_test:focal:
stage: build_and_test
image: labrobotica/wolf_deps_ros:20.04
cache:
- key: wolf-focal
paths:
- ci_deps/wolf/
- key: gnssutils-focal
paths:
- ci_deps/gnss_utils/
- key: gnss-focal
paths:
- ci_deps/gnss/
before_script:
- *preliminaries_definition
- *install_wolf_definition
- *install_gnssutils_definition
- *install_wolfgnss_definition
- *clone_wolfrosnode_definition
- ldconfig
script:
- *build_and_test_definition
############ RUN DEMOS ############
demo_gnss:
stage: demos
variables:
WOLF_CORE_BRANCH: $WOLF_CORE_BRANCH
WOLF_GNSS_BRANCH: $WOLF_GNSS_BRANCH
WOLF_ROS_CORE_BRANCH: $WOLF_ROS_CORE_BRANCH
WOLF_ROS_GNSS_BRANCH: $CI_COMMIT_BRANCH
trigger:
project: mobile_robotics/wolf_projects/wolf_ros/demos/wolf_demo_gnss_imu
......@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8.3)
project(wolf_ros_gnss)
## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)
add_compile_options(-std=c++14)
# SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/wolf_ros_wrapper/cmake_modules")
## Find catkin macros and libraries
......@@ -11,18 +11,19 @@ add_compile_options(-std=c++11)
find_package(catkin REQUIRED COMPONENTS
roscpp
sensor_msgs
iri_gnss_msgs
std_msgs
tf
tf_conversions
dynamic_reconfigure
wolf_ros_node
)
# OPTIONAL PACKAGES
find_package(iri_gnss_msgs QUIET)
find_package(novatel_oem7_msgs QUIET)
## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)
# find_package(Ceres REQUIRED)
# find_package(Eigen3 REQUIRED)
find_package(wolf REQUIRED)
find_package(wolfcore REQUIRED)
find_package(wolfgnss REQUIRED)
## Uncomment this if the package has a setup.py. This macro ensures
......@@ -120,24 +121,74 @@ catkin_package(
## Build ##
###########
set(INCLUDE_DIRS
include
${EIGEN_INCLUDE_DIRS}
${wolfcore_INCLUDE_DIRS}
${wolfgnss_INCLUDE_DIRS}
${gnss_utils_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
)
set(PUB_SRCS
#src/publisher_gnss_fix.cpp
src/publisher_gnss_tf.cpp
src/publisher_gnss_accuracy.cpp
src/publisher_tracker_gnss_info.cpp
)
set(SUB_SRCS
src/subscriber_gnss_fix.cpp
src/subscriber_gnss_fix_publisher_ecef.cpp
src/subscriber_gnss_receiver.cpp
src/subscriber_gnss_ublox.cpp
)
set(LIBRARIES
${wolfcore_LIBRARIES}
${wolfgnss_LIBRARIES}
${iri_gnss_msgs_LIBRARIES}
${catkin_LIBRARIES}
)
# OPTIONAL iri_gnss_msgs dependant code
if (iri_gnss_msgs_FOUND)
message("iri_gnss_msgs FOUND: compiling dependant code")
list(APPEND SUB_SRCS
src/subscriber_gnss.cpp
src/subscriber_gnss_tdcp.cpp
)
list(APPEND INCLUDE_DIRS ${iri_gnss_msgs_INCLUDE_DIRS})
list(APPEND LIBRARIES ${iri_gnss_msgs_LIBRARIES})
endif()
# OPTIONAL iri_gnss_msgs dependant code
if (novatel_oem7_msgs_FOUND)
message("novatel_oem7_msgs FOUND: compiling dependant code")
list(APPEND SUB_SRCS
src/subscriber_gnss_novatel.cpp
)
if (iri_gnss_msgs_FOUND)
list(APPEND SUB_SRCS
src/subscriber_gnss_fix_novatel_publisher_ecef.cpp
)
endif()
list(APPEND INCLUDE_DIRS ${novatel_oem7_msgs_INCLUDE_DIRS})
endif()
## Specify additional locations of header files
## Your package locations should be listed before other locations
message("Wolf include path: ${wolf_INCLUDE_DIR}")
include_directories(
include
${EIGEN_INCLUDE_DIRS}
${wolf_INCLUDE_DIRS}
${wolfgnss_INCLUDE_DIRS}
${gnss_utils_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
${CERES_INCLUDE_DIRS}
)
message("Wolf include path: ${wolfcore_INCLUDE_DIRS}")
message("iri_gnss_msgs include path: ${iri_gnss_msgs_INCLUDE_DIRS}")
include_directories(${INCLUDE_DIRS})
# link_directories(/usr/local/lib/iri-algorithms)
## Declare a C++ library
# add_library(${PROJECT_NAME}
# src/${PROJECT_NAME}/wolf_ros.cpp
# )
add_library(wolf_subscriber_gnss src/wolf_ros_subscriber_gnss.cpp)
add_library(publisher_${PROJECT_NAME} ${PUB_SRCS})
add_library(subscriber_${PROJECT_NAME} ${SUB_SRCS})
## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
......@@ -159,13 +210,16 @@ add_library(wolf_subscriber_gnss src/wolf_ros_subscriber_gnss.cpp)
## same as for the library above
#add_dependencies(${PROJECT_NAME}_node ${PROJECT_NAME}_gencfg)
#add_dependencies(${PROJECT_NAME}_visualizer ${PROJECT_NAME}_gencfg)
if (iri_gnss_msgs_FOUND)
add_dependencies(subscriber_${PROJECT_NAME} iri_gnss_msgs_generate_messages_cpp)
endif()
if (novatel_oem7_msgs_FOUND)
add_dependencies(subscriber_${PROJECT_NAME} novatel_oem7_msgs_generate_messages_cpp)
endif()
## Specify libraries to link a library or executable target against
target_link_libraries(wolf_subscriber_gnss
${wolf_LIBRARIES}
${wolfgnss_LIBRARIES}
${iri_gnss_msgs_LIBRARIES}
)
target_link_libraries(subscriber_${PROJECT_NAME} ${LIBRARIES})
target_link_libraries(publisher_${PROJECT_NAME} ${LIBRARIES})
#############
## Install ##
......
This diff is collapsed.
# wolf_ros_gnss
This is the ros package of the [WOLF GNSS plugin](https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_lib/plugins/gnss).
# Other dependencies
**iri_gnss_msgs**
Clone package and generate ROS messages. In a new terminal:
```
roscd
cd ../src
git clone ssh://git@gitlab.iri.upc.edu:2202/mobile_robotics/gauss_project/iri_gnss_msgs.git
cd ..
catkin_make --only-pkg-with-deps iri_gnss_msgs
```
**Novatel OEM7 msgs**
Clone package and generate ROS messages. In a new terminal:
```
roscd
cd ../src
git clone ssh://git@gitlab.iri.upc.edu:2202/mobile_robotics/gauss_project/novatel_oem7_driver.git
cd ..
catkin_make --only-pkg-with-deps novatel_oem7_msgs
```
\ No newline at end of file
//--------LICENSE_START--------
//
// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
// Authors: Joan Solà Ortega (jsola@iri.upc.edu)
// All rights reserved.
//
// This file is part of WOLF
// WOLF is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
//--------LICENSE_END--------
#ifndef PUBLISHER_GNSS_ACCURACY_H
#define PUBLISHER_GNSS_ACCURACY_H
/**************************
* WOLF includes *
**************************/
#include "core/problem/problem.h"
#include "publisher.h"
/**************************
* ROS includes *
**************************/
#include <ros/ros.h>
#include <visualization_msgs/Marker.h>
namespace wolf
{
class PublisherGnssAccuracy: public Publisher
{
visualization_msgs::Marker PL_marker_msg_;
std_msgs::ColorRGBA marker_color_;
SensorBasePtr sensor_;
double k_H_, k_V_;
public:
PublisherGnssAccuracy(const std::string& _unique_name,
const ParamsServer& _server,
const ProblemPtr _problem);
WOLF_PUBLISHER_CREATE(PublisherGnssAccuracy);
virtual ~PublisherGnssAccuracy(){};
void initialize(ros::NodeHandle &nh, const std::string& topic) override;
void publishDerived() override;
};
WOLF_REGISTER_PUBLISHER(PublisherGnssAccuracy)
}
#endif
//--------LICENSE_START--------
//
// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
// Authors: Joan Solà Ortega (jsola@iri.upc.edu)
// All rights reserved.
//
// This file is part of WOLF
// WOLF is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
//--------LICENSE_END--------
#ifndef PUBLISHER_FIX_H
#define PUBLISHER_FIX_H
/**************************
* WOLF includes *
**************************/
#include "core/problem/problem.h"
#include "publisher.h"
/**************************
* ROS includes *
**************************/
#include <ros/ros.h>
#include <geometry_msgs/PoseWithCovarianceStamped.h>
#include <visualization_msgs/Marker.h>
#include <tf/transform_listener.h>
namespace wolf
{
class PublishGnssFix: public Publisher
{
geometry_msgs::PoseArray pose_array_msg_;
geometry_msgs::PoseStamped pose_msg_;
visualization_msgs::Marker marker_msg_;
SensorBasePtr sensor_;
std::string frame_id_, map_frame_id_;
ros::Publisher pub_pose_array_, pub_marker_, pub_pose_;
public:
PublishGnssFix(const std::string& _unique_name,
const ParamsServer& _server,
const ProblemPtr _problem);
WOLF_PUBLISHER_CREATE(PublishGnssFix);
virtual ~PublishGnssFix(){};
void initialize(ros::NodeHandle &nh, const std::string& topic) override;
void publishDerived() override;
void publishPose(const geometry_msgs::Pose pose, const ros::Time& stamp);
protected:
bool listenTf();
Eigen::Quaterniond q_frame_;
Eigen::Vector3d t_frame_;
tf::TransformListener tfl_;
};
WOLF_REGISTER_PUBLISHER(PublishGnssFix)
}
#endif
//--------LICENSE_START--------
//
// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
// Authors: Joan Solà Ortega (jsola@iri.upc.edu)
// All rights reserved.
//
// This file is part of WOLF
// WOLF is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
//--------LICENSE_END--------
#ifndef PUBLISHER_GNSS_TF_H
#define PUBLISHER_GNSS_TF_H
/**************************
* WOLF includes *
**************************/
#include "core/problem/problem.h"
#include "gnss/sensor/sensor_gnss.h"
#include "publisher.h"
#include <tf/transform_broadcaster.h>
namespace wolf
{
class PublisherGnssTf: public Publisher
{
std::string map_frame_id_, enu_frame_id_, ecef_frame_id_;
tf::StampedTransform T_enu_map_, T_ecef_enu_;
tf::TransformBroadcaster tfb_;
SensorGnssPtr sensor_gnss_;
public:
PublisherGnssTf(const std::string& _unique_name,
const ParamsServer& _server,
const ProblemPtr _problem);
WOLF_PUBLISHER_CREATE(PublisherGnssTf);
virtual ~PublisherGnssTf(){};
void initialize(ros::NodeHandle &nh, const std::string& topic) override;
void publishDerived() override;
};
WOLF_REGISTER_PUBLISHER(PublisherGnssTf)
}
#endif
//--------LICENSE_START--------
//
// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
// Authors: Joan Solà Ortega (jsola@iri.upc.edu)
// All rights reserved.
//
// This file is part of WOLF
// WOLF is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
//--------LICENSE_END--------
#ifndef PUBLISHER_TRACKER_GNSS_INFO_H
#define PUBLISHER_TRACKER_GNSS_INFO_H
/**************************
* WOLF includes *
**************************/
#include "core/problem/problem.h"
#include "gnss/processor/processor_tracker_gnss.h"
#include "publisher.h"
/**************************
* ROS includes *
**************************/
#include <ros/ros.h>
namespace wolf
{
class PublisherTrackerGnssInfo: public Publisher
{
protected:
ProcessorTrackerGnssPtr processor_tracker_gnss_;
ros::Publisher publisher_untracked_;
public:
PublisherTrackerGnssInfo(const std