Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

Commit

Permalink
Merge branch 'release-v0.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Olav de Haas committed Jan 16, 2020
2 parents 40fee22 + ed7d3db commit 9584e51
Show file tree
Hide file tree
Showing 111 changed files with 1,939 additions and 1,976 deletions.
65 changes: 65 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
BasedOnStyle: Google
AccessModifierOffset: -2
ConstructorInitializerIndentWidth: 2
AlignEscapedNewlinesLeft: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: false
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: true
BinPackParameters: true
ColumnLimit: 120
ConstructorInitializerAllOnOneLineOrOnePerLine: true
DerivePointerBinding: false
PointerBindsToType: true
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 60
PenaltyBreakString: 1
PenaltyBreakFirstLessLess: 1000
PenaltyExcessCharacter: 1000
PenaltyReturnTypeOnItsOwnLine: 90
SpacesBeforeTrailingComments: 2
Cpp11BracedListStyle: false
Standard: Auto
IndentWidth: 2
TabWidth: 2
UseTab: Never
IndentFunctionDeclarationAfterType: false
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
SortIncludes: false
SpaceAfterCStyleCast: false

# Configure each individual brace in BraceWrapping
BreakBeforeBraces: Custom

# Control of individual brace wrapping cases
BraceWrapping: {
AfterClass: 'true'
AfterControlStatement: 'true'
AfterEnum : 'true'
AfterFunction : 'true'
AfterNamespace : 'true'
AfterStruct : 'true'
AfterUnion : 'true'
BeforeCatch : 'true'
BeforeElse : 'true'
IndentBraces : 'false'
}
...
14 changes: 9 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ env:
- CCACHE_DIR=$HOME/.ccache # enables C/C++ caching in industrial_ci
- BUILDER=colcon
- CATKIN_LINT=pedantic
- UPSTREAM_WORKSPACE='.rosinstall -march/march_gait_scheduler -march/march_gait_selection -march/march_launch -march/march_rqt_launch_menu -march/march_safety -march/march_sound_scheduler -march/march_state_machine'
- AFTER_SCRIPT='builder_run_build "$target_ws/install" "$target_ws" --cmake-target-skip-unavailable --cmake-target roslint'
matrix:
- ROS_DISTRO=kinetic
- ROS_DISTRO=melodic
- CATKIN_LINT_ARGS='--ignore literal_project_name --ignore target_name_collision'
- UPSTREAM_WORKSPACE='.rosinstall -march/march_data_collector -march/march_gait_scheduler -march/march_gain_scheduling -march/march_gait_selection -march/march_launch -march/march_safety -march/march_sound_scheduler -march/march_state_machine'

jobs:
include:
- name: "Melodic"
env: ROS_DISTRO=melodic
- name: "clang-format"
env: ROS_DISTRO=melodic CLANG_FORMAT_CHECK=file

# clone and run industrial_ci
install:
Expand Down
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @project-march/v-software @bjornminderman @Olavhaasie
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Hardware Interface
The hardware interface of the MARCH exoskeleton. This includes EtherCAT master and uses the SOEM library.

![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/project-march/hardware-interface?include_prereleases)

| Branch | Build Status |
| ------ |:------------:|
| Master | [![Build Status](https://api.travis-ci.com/project-march/hardware-interface.svg?branch=master)](https://travis-ci.com/project-march/hardware-interface) |
| Develop | [![Build Status](https://api.travis-ci.com/project-march/hardware-interface.svg?branch=develop)](https://travis-ci.com/project-march/hardware-interface) |
| master | [![Build Status](https://api.travis-ci.com/project-march/hardware-interface.svg?branch=master)](https://travis-ci.com/project-march/hardware-interface) |
| develop | [![Build Status](https://api.travis-ci.com/project-march/hardware-interface.svg?branch=develop)](https://travis-ci.com/project-march/hardware-interface) |

9 changes: 0 additions & 9 deletions doc.sh

This file was deleted.

34 changes: 2 additions & 32 deletions march_hardware/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
cmake_minimum_required(VERSION 2.8.3)
project(march_hardware)

add_compile_options(-std=c++11)
add_compile_options(-std=c++11 -Wall -Wextra)

find_package(catkin REQUIRED COMPONENTS
roscpp
roslint
soem
)

Expand All @@ -15,18 +14,9 @@ catkin_package(
LIBRARIES ${PROJECT_NAME}
)

set(ROSLINT_CPP_OPTS "--filter=-build/include,-build/header_guard,-runtime/references" "--linelength=120")

file(GLOB_RECURSE lintfiles
"src/*.cpp"
"include/*.h"
)

roslint_cpp(${lintfiles})


include_directories(
include
SYSTEM
${catkin_INCLUDE_DIRS}
${soem_INCLUDE_DIRS}/soem
)
Expand All @@ -36,26 +26,6 @@ install(DIRECTORY include/${PROJECT_NAME}/
)

add_library(${PROJECT_NAME}
include/${PROJECT_NAME}/ActuationMode.h
include/${PROJECT_NAME}/AngleConversions.h
include/${PROJECT_NAME}/BootShutdownOffsets.h
include/${PROJECT_NAME}/Encoder.h
include/${PROJECT_NAME}/EtherCAT/EthercatIO.h
include/${PROJECT_NAME}/EtherCAT/EthercatMaster.h
include/${PROJECT_NAME}/EtherCAT/EthercatSDO.h
include/${PROJECT_NAME}/HighVoltage.h
include/${PROJECT_NAME}/IMotionCube.h
include/${PROJECT_NAME}/IMotionCubeState.h
include/${PROJECT_NAME}/IMotionCubeTargetState.h
include/${PROJECT_NAME}/Joint.h
include/${PROJECT_NAME}/LowVoltage.h
include/${PROJECT_NAME}/MarchRobot.h
include/${PROJECT_NAME}/NetDriverOffsets.h
include/${PROJECT_NAME}/PDOmap.h
include/${PROJECT_NAME}/PowerDistributionBoard.h
include/${PROJECT_NAME}/Slave.h
include/${PROJECT_NAME}/TemperatureGES.h
include/${PROJECT_NAME}/TemperatureSensor.h
src/Encoder.cpp
src/EtherCAT/EthercatIO.cpp
src/EtherCAT/EthercatMaster.cpp
Expand Down
46 changes: 23 additions & 23 deletions march_hardware/check/SlaveCount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,31 @@

int main(int argc, char** argv)
{
ros::init(argc, argv, "slave_count_check");
ros::NodeHandle nh;
ros::init(argc, argv, "slave_count_check");
ros::NodeHandle nh;

ROS_INFO("Trying to start EtherCAT");
std::string ifname = "enp2s0";
ROS_INFO("Trying to start EtherCAT");
std::string ifname = "enp2s0";

// Initialise SOEM, bind socket to ifname
if (!ec_init(&ifname[0]))
{
ROS_FATAL("No socket connection on %s. Confirm that you have selected the right ifname", ifname.c_str());
nh.setParam("/check/slave_count", 0);
return 1;
}
ROS_INFO("ec_init on %s succeeded", ifname.c_str());
// Initialise SOEM, bind socket to ifname
if (!ec_init(&ifname[0]))
{
ROS_FATAL("No socket connection on %s. Confirm that you have selected the right ifname", ifname.c_str());
nh.setParam("/check/slave_count", 0);
return 1;
}
ROS_INFO("ec_init on %s succeeded", ifname.c_str());

// Find and auto-config slaves
if (ec_config_init(FALSE) <= 0)
{
ROS_FATAL("No slaves found, shutting down. Confirm that you have selected the right ifname.");
ROS_FATAL("Check that the first slave is connected properly");
nh.setParam("/check/slave_count", 0);
return 1;
}
ROS_INFO("%d slave(s) found and initialized.", ec_slavecount);
// Find and auto-config slaves
if (ec_config_init(FALSE) <= 0)
{
ROS_FATAL("No slaves found, shutting down. Confirm that you have selected the right ifname.");
ROS_FATAL("Check that the first slave is connected properly");
nh.setParam("/check/slave_count", 0);
return 1;
}
ROS_INFO("%d slave(s) found and initialized.", ec_slavecount);

nh.setParam("/check/slave_count", ec_slavecount);
return 0;
nh.setParam("/check/slave_count", ec_slavecount);
return 0;
}
8 changes: 4 additions & 4 deletions march_hardware/include/march_hardware/ActuationMode.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2019 Project March.

#ifndef MARCH_HARDWARE_INTERFACE_ACTUATIONMODE_H
#define MARCH_HARDWARE_INTERFACE_ACTUATIONMODE_H

#ifndef MARCH_HARDWARE_ACTUATIONMODE_H
#define MARCH_HARDWARE_ACTUATIONMODE_H
#include <string>
#include <ros/console.h>

namespace march4cpp
Expand Down Expand Up @@ -89,4 +89,4 @@ class ActuationMode
};
} // namespace march4cpp

#endif // MARCH_HARDWARE_INTERFACE_ACTUATIONMODE_H
#endif // MARCH_HARDWARE_ACTUATIONMODE_H
6 changes: 3 additions & 3 deletions march_hardware/include/march_hardware/AngleConversions.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2019 Project March.
#ifndef PROJECT_ANGLECONVERSIONS_H
#define PROJECT_ANGLECONVERSIONS_H
#ifndef MARCH_HARDWARE_ANGLECONVERSIONS_H
#define MARCH_HARDWARE_ANGLECONVERSIONS_H

#include <cmath>

Expand All @@ -14,4 +14,4 @@ float RadtoDeg(float rad)
return static_cast<float>(rad * 180 / M_PI);
}

#endif // PROJECT_ANGLECONVERSIONS_H
#endif // MARCH_HARDWARE_ANGLECONVERSIONS_H
6 changes: 3 additions & 3 deletions march_hardware/include/march_hardware/BootShutdownOffsets.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2019 Project March.
#ifndef MARCH_IV_BOOTSHUTDOWNOFFSETS_H
#define MARCH_IV_BOOTSHUTDOWNOFFSETS_H
#ifndef MARCH_HARDWARE_BOOTSHUTDOWNOFFSETS_H
#define MARCH_HARDWARE_BOOTSHUTDOWNOFFSETS_H

#include <ros/ros.h>

Expand Down Expand Up @@ -73,4 +73,4 @@ class BootShutdownOffsets
}
};

#endif // MARCH_IV_BOOTSHUTDOWNOFFSETS_H
#endif // MARCH_HARDWARE_BOOTSHUTDOWNOFFSETS_H
6 changes: 3 additions & 3 deletions march_hardware/include/march_hardware/Encoder.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2019 Project March.

#ifndef PROJECT_ENCODER_H
#define PROJECT_ENCODER_H
#ifndef MARCH_HARDWARE_ENCODER_H
#define MARCH_HARDWARE_ENCODER_H

#include <ostream>

Expand Down Expand Up @@ -77,4 +77,4 @@ class Encoder
};
} // namespace march4cpp

#endif // PROJECT_ENCODER_H
#endif // MARCH_HARDWARE_ENCODER_H
Loading

0 comments on commit 9584e51

Please sign in to comment.