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

Commit 9584e51

Browse files
author
Olav de Haas
committed
Merge branch 'release-v0.1.0'
2 parents 40fee22 + ed7d3db commit 9584e51

File tree

111 files changed

+1939
-1976
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+1939
-1976
lines changed

.clang-format

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
BasedOnStyle: Google
3+
AccessModifierOffset: -2
4+
ConstructorInitializerIndentWidth: 2
5+
AlignEscapedNewlinesLeft: false
6+
AlignTrailingComments: true
7+
AllowAllParametersOfDeclarationOnNextLine: false
8+
AllowShortIfStatementsOnASingleLine: false
9+
AllowShortLoopsOnASingleLine: false
10+
AllowShortFunctionsOnASingleLine: None
11+
AlwaysBreakTemplateDeclarations: true
12+
AlwaysBreakBeforeMultilineStrings: false
13+
BreakBeforeBinaryOperators: false
14+
BreakBeforeTernaryOperators: false
15+
BreakConstructorInitializersBeforeComma: true
16+
BinPackParameters: true
17+
ColumnLimit: 120
18+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
19+
DerivePointerBinding: false
20+
PointerBindsToType: true
21+
ExperimentalAutoDetectBinPacking: false
22+
IndentCaseLabels: true
23+
MaxEmptyLinesToKeep: 1
24+
NamespaceIndentation: None
25+
ObjCSpaceBeforeProtocolList: true
26+
PenaltyBreakBeforeFirstCallParameter: 19
27+
PenaltyBreakComment: 60
28+
PenaltyBreakString: 1
29+
PenaltyBreakFirstLessLess: 1000
30+
PenaltyExcessCharacter: 1000
31+
PenaltyReturnTypeOnItsOwnLine: 90
32+
SpacesBeforeTrailingComments: 2
33+
Cpp11BracedListStyle: false
34+
Standard: Auto
35+
IndentWidth: 2
36+
TabWidth: 2
37+
UseTab: Never
38+
IndentFunctionDeclarationAfterType: false
39+
SpacesInParentheses: false
40+
SpacesInAngles: false
41+
SpaceInEmptyParentheses: false
42+
SpacesInCStyleCastParentheses: false
43+
SpaceAfterControlStatementKeyword: true
44+
SpaceBeforeAssignmentOperators: true
45+
ContinuationIndentWidth: 4
46+
SortIncludes: false
47+
SpaceAfterCStyleCast: false
48+
49+
# Configure each individual brace in BraceWrapping
50+
BreakBeforeBraces: Custom
51+
52+
# Control of individual brace wrapping cases
53+
BraceWrapping: {
54+
AfterClass: 'true'
55+
AfterControlStatement: 'true'
56+
AfterEnum : 'true'
57+
AfterFunction : 'true'
58+
AfterNamespace : 'true'
59+
AfterStruct : 'true'
60+
AfterUnion : 'true'
61+
BeforeCatch : 'true'
62+
BeforeElse : 'true'
63+
IndentBraces : 'false'
64+
}
65+
...

.travis.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,15 @@ env:
2828
- CCACHE_DIR=$HOME/.ccache # enables C/C++ caching in industrial_ci
2929
- BUILDER=colcon
3030
- CATKIN_LINT=pedantic
31-
- 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'
32-
- AFTER_SCRIPT='builder_run_build "$target_ws/install" "$target_ws" --cmake-target-skip-unavailable --cmake-target roslint'
33-
matrix:
34-
- ROS_DISTRO=kinetic
35-
- ROS_DISTRO=melodic
31+
- CATKIN_LINT_ARGS='--ignore literal_project_name --ignore target_name_collision'
32+
- 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'
33+
34+
jobs:
35+
include:
36+
- name: "Melodic"
37+
env: ROS_DISTRO=melodic
38+
- name: "clang-format"
39+
env: ROS_DISTRO=melodic CLANG_FORMAT_CHECK=file
3640

3741
# clone and run industrial_ci
3842
install:

CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @project-march/v-software @bjornminderman @Olavhaasie

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Hardware Interface
22
The hardware interface of the MARCH exoskeleton. This includes EtherCAT master and uses the SOEM library.
33

4+
![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/project-march/hardware-interface?include_prereleases)
5+
46
| Branch | Build Status |
57
| ------ |:------------:|
6-
| Master | [![Build Status](https://api.travis-ci.com/project-march/hardware-interface.svg?branch=master)](https://travis-ci.com/project-march/hardware-interface) |
7-
| Develop | [![Build Status](https://api.travis-ci.com/project-march/hardware-interface.svg?branch=develop)](https://travis-ci.com/project-march/hardware-interface) |
8+
| master | [![Build Status](https://api.travis-ci.com/project-march/hardware-interface.svg?branch=master)](https://travis-ci.com/project-march/hardware-interface) |
9+
| develop | [![Build Status](https://api.travis-ci.com/project-march/hardware-interface.svg?branch=develop)](https://travis-ci.com/project-march/hardware-interface) |
810

doc.sh

-9
This file was deleted.

march_hardware/CMakeLists.txt

+2-32
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
cmake_minimum_required(VERSION 2.8.3)
22
project(march_hardware)
33

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

66
find_package(catkin REQUIRED COMPONENTS
77
roscpp
8-
roslint
98
soem
109
)
1110

@@ -15,18 +14,9 @@ catkin_package(
1514
LIBRARIES ${PROJECT_NAME}
1615
)
1716

18-
set(ROSLINT_CPP_OPTS "--filter=-build/include,-build/header_guard,-runtime/references" "--linelength=120")
19-
20-
file(GLOB_RECURSE lintfiles
21-
"src/*.cpp"
22-
"include/*.h"
23-
)
24-
25-
roslint_cpp(${lintfiles})
26-
27-
2817
include_directories(
2918
include
19+
SYSTEM
3020
${catkin_INCLUDE_DIRS}
3121
${soem_INCLUDE_DIRS}/soem
3222
)
@@ -36,26 +26,6 @@ install(DIRECTORY include/${PROJECT_NAME}/
3626
)
3727

3828
add_library(${PROJECT_NAME}
39-
include/${PROJECT_NAME}/ActuationMode.h
40-
include/${PROJECT_NAME}/AngleConversions.h
41-
include/${PROJECT_NAME}/BootShutdownOffsets.h
42-
include/${PROJECT_NAME}/Encoder.h
43-
include/${PROJECT_NAME}/EtherCAT/EthercatIO.h
44-
include/${PROJECT_NAME}/EtherCAT/EthercatMaster.h
45-
include/${PROJECT_NAME}/EtherCAT/EthercatSDO.h
46-
include/${PROJECT_NAME}/HighVoltage.h
47-
include/${PROJECT_NAME}/IMotionCube.h
48-
include/${PROJECT_NAME}/IMotionCubeState.h
49-
include/${PROJECT_NAME}/IMotionCubeTargetState.h
50-
include/${PROJECT_NAME}/Joint.h
51-
include/${PROJECT_NAME}/LowVoltage.h
52-
include/${PROJECT_NAME}/MarchRobot.h
53-
include/${PROJECT_NAME}/NetDriverOffsets.h
54-
include/${PROJECT_NAME}/PDOmap.h
55-
include/${PROJECT_NAME}/PowerDistributionBoard.h
56-
include/${PROJECT_NAME}/Slave.h
57-
include/${PROJECT_NAME}/TemperatureGES.h
58-
include/${PROJECT_NAME}/TemperatureSensor.h
5929
src/Encoder.cpp
6030
src/EtherCAT/EthercatIO.cpp
6131
src/EtherCAT/EthercatMaster.cpp

march_hardware/check/SlaveCount.cpp

+23-23
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,31 @@
1414

1515
int main(int argc, char** argv)
1616
{
17-
ros::init(argc, argv, "slave_count_check");
18-
ros::NodeHandle nh;
17+
ros::init(argc, argv, "slave_count_check");
18+
ros::NodeHandle nh;
1919

20-
ROS_INFO("Trying to start EtherCAT");
21-
std::string ifname = "enp2s0";
20+
ROS_INFO("Trying to start EtherCAT");
21+
std::string ifname = "enp2s0";
2222

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

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

42-
nh.setParam("/check/slave_count", ec_slavecount);
43-
return 0;
42+
nh.setParam("/check/slave_count", ec_slavecount);
43+
return 0;
4444
}

march_hardware/include/march_hardware/ActuationMode.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright 2019 Project March.
22

3-
#ifndef MARCH_HARDWARE_INTERFACE_ACTUATIONMODE_H
4-
#define MARCH_HARDWARE_INTERFACE_ACTUATIONMODE_H
5-
3+
#ifndef MARCH_HARDWARE_ACTUATIONMODE_H
4+
#define MARCH_HARDWARE_ACTUATIONMODE_H
5+
#include <string>
66
#include <ros/console.h>
77

88
namespace march4cpp
@@ -89,4 +89,4 @@ class ActuationMode
8989
};
9090
} // namespace march4cpp
9191

92-
#endif // MARCH_HARDWARE_INTERFACE_ACTUATIONMODE_H
92+
#endif // MARCH_HARDWARE_ACTUATIONMODE_H

march_hardware/include/march_hardware/AngleConversions.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 2019 Project March.
2-
#ifndef PROJECT_ANGLECONVERSIONS_H
3-
#define PROJECT_ANGLECONVERSIONS_H
2+
#ifndef MARCH_HARDWARE_ANGLECONVERSIONS_H
3+
#define MARCH_HARDWARE_ANGLECONVERSIONS_H
44

55
#include <cmath>
66

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

17-
#endif // PROJECT_ANGLECONVERSIONS_H
17+
#endif // MARCH_HARDWARE_ANGLECONVERSIONS_H

march_hardware/include/march_hardware/BootShutdownOffsets.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 2019 Project March.
2-
#ifndef MARCH_IV_BOOTSHUTDOWNOFFSETS_H
3-
#define MARCH_IV_BOOTSHUTDOWNOFFSETS_H
2+
#ifndef MARCH_HARDWARE_BOOTSHUTDOWNOFFSETS_H
3+
#define MARCH_HARDWARE_BOOTSHUTDOWNOFFSETS_H
44

55
#include <ros/ros.h>
66

@@ -73,4 +73,4 @@ class BootShutdownOffsets
7373
}
7474
};
7575

76-
#endif // MARCH_IV_BOOTSHUTDOWNOFFSETS_H
76+
#endif // MARCH_HARDWARE_BOOTSHUTDOWNOFFSETS_H

march_hardware/include/march_hardware/Encoder.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2019 Project March.
22

3-
#ifndef PROJECT_ENCODER_H
4-
#define PROJECT_ENCODER_H
3+
#ifndef MARCH_HARDWARE_ENCODER_H
4+
#define MARCH_HARDWARE_ENCODER_H
55

66
#include <ostream>
77

@@ -77,4 +77,4 @@ class Encoder
7777
};
7878
} // namespace march4cpp
7979

80-
#endif // PROJECT_ENCODER_H
80+
#endif // MARCH_HARDWARE_ENCODER_H

0 commit comments

Comments
 (0)