Skip to content

Commit eb61dc1

Browse files
committed
style: cpp format
1 parent 4ccffe8 commit eb61dc1

16 files changed

Lines changed: 36 additions & 32 deletions

File tree

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,27 @@ COMPILE_MODE = Release
55
# CPP
66
cppcheckformat:
77
clang-format --dry-run -Werror -i $(shell find ${CPPSRC} -name '*.cpp' -o -name '*.cc' -o -name '*.h')
8+
clang-format --dry-run -Werror -i $(shell find extensions/rcs_fr3/src -name '*.cpp' -o -name '*.cc' -o -name '*.h')
89

910
cppformat:
1011
clang-format -Werror -i $(shell find ${CPPSRC} -name '*.cpp' -o -name '*.cc' -o -name '*.h')
12+
clang-format -Werror -i $(shell find extensions/rcs_fr3/src -name '*.cpp' -o -name '*.cc' -o -name '*.h')
1113

1214
cpplint:
1315
clang-tidy -p=build --warnings-as-errors='*' $(shell find ${CPPSRC} -name '*.cpp' -o -name '*.cc' -name '*.h')
1416

17+
# import errors
18+
# clang-tidy -p=build --warnings-as-errors='*' $(shell find extensions/rcs_fr3/src -name '*.cpp' -o -name '*.cc' -name '*.h')
19+
1520
gcccompile:
1621
pip install --upgrade --requirement requirements_dev.txt
1722
cmake -DCMAKE_BUILD_TYPE=${COMPILE_MODE} -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -B build -G Ninja
18-
cmake --build build --target _core franka
23+
cmake --build build --target _core
1924

2025
clangcompile:
2126
pip install --upgrade --requirement requirements_dev.txt
2227
cmake -DCMAKE_BUILD_TYPE=${COMPILE_MODE} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -B build -G Ninja
23-
cmake --build build --target _core franka
28+
cmake --build build --target _core
2429

2530
# Auto generation of CPP binding stub files
2631
stubgen:

extensions/rcs_fr3/src/hw/FR3.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
#ifndef RCS_FR3_H
22
#define RCS_FR3_H
33

4-
#include "rcs/IK.h"
5-
#include "rcs/LinearPoseTrajInterpolator.h"
6-
#include "rcs/Pose.h"
7-
#include "rcs/Robot.h"
8-
#include "rcs/utils.h"
94
#include <franka/robot.h>
105

116
#include <cmath>
@@ -15,6 +10,12 @@
1510
#include <string>
1611
#include <thread>
1712

13+
#include "rcs/IK.h"
14+
#include "rcs/LinearPoseTrajInterpolator.h"
15+
#include "rcs/Pose.h"
16+
#include "rcs/Robot.h"
17+
#include "rcs/utils.h"
18+
1819
namespace rcs {
1920
namespace hw {
2021

extensions/rcs_fr3/src/hw/FR3MotionGenerator.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#ifndef RCS_MOTION_GENERATOR_H
22
#define RCS_MOTION_GENERATOR_H
33

4-
#include "rcs/Robot.h"
5-
#include "rcs/utils.h"
64
#include <franka/control_types.h>
75
#include <franka/duration.h>
86
#include <franka/exception.h>
@@ -12,6 +10,9 @@
1210
#include <Eigen/Core>
1311
#include <array>
1412

13+
#include "rcs/Robot.h"
14+
#include "rcs/utils.h"
15+
1516
namespace rcs {
1617
namespace hw {
1718

extensions/rcs_fr3/src/hw/FrankaHand.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#ifndef RCS_FRANKA_HAND_H
22
#define RCS_FRANKA_HAND_H
33

4-
#include "rcs/Robot.h"
54
#include <franka/gripper.h>
65

76
#include <Eigen/Core>
87
#include <cmath>
98
#include <string>
109
#include <thread>
1110

11+
#include "rcs/Robot.h"
12+
1213
// TODO: we need a common interface for the gripper, maybe we do use the hal
1314
// we need to create a robot class that has both the robot and the gripper
1415

extensions/rcs_fr3/src/hw/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#include <rcs/IK.h>
21
#include <franka/exception.h>
32
#include <franka/gripper.h>
43
#include <franka/robot.h>
4+
#include <rcs/IK.h>
55

66
#include <iostream>
77
#include <memory>

extensions/rcs_fr3/src/pybind/rcs.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
#include "rcs/IK.h"
2-
#include "rcs/Pose.h"
3-
#include "rcs/Robot.h"
4-
#include "rcs/utils.h"
51
#include <franka/exception.h>
62
#include <hw/FR3.h>
73
#include <hw/FrankaHand.h>
@@ -13,6 +9,10 @@
139

1410
#include <memory>
1511

12+
#include "rcs/IK.h"
13+
#include "rcs/Pose.h"
14+
#include "rcs/Robot.h"
15+
#include "rcs/utils.h"
1616
#include "rl/mdl/UrdfFactory.h"
1717

1818
// TODO: define exceptions
@@ -148,5 +148,4 @@ PYBIND11_MODULE(_core, m) {
148148
hw_except, "FrankaRealtimeException", PyExc_RuntimeError);
149149
py::register_exception<franka::InvalidOperationException>(
150150
hw_except, "FrankaInvalidOperationException", PyExc_RuntimeError);
151-
152151
}

extensions/rcs_fr3/src/rcs_fr3/creators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
from rcs.envs.creators import RCSHardwareEnvCreator
1919
from rcs.envs.sim import CollisionGuard
2020
from rcs.hand.tilburg_hand import TilburgHand
21+
from rcs_fr3 import hw
2122
from rcs_fr3.envs import FR3HW
2223
from rcs_fr3.utils import default_fr3_hw_gripper_cfg, default_fr3_hw_robot_cfg
23-
from rcs_fr3 import hw
2424

2525
import rcs
2626

extensions/rcs_fr3/src/rcs_fr3/desk.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@
1010
from typing import Callable, Literal
1111
from urllib import parse
1212

13+
import rcs_fr3
1314
import requests
1415
from dotenv import load_dotenv
1516
from rcs_fr3.utils import default_fr3_hw_gripper_cfg
16-
import rcs_fr3
1717
from requests.packages import urllib3 # type: ignore[attr-defined]
1818
from websockets.sync.client import connect
1919

20-
2120
_logger = logging.getLogger("desk")
2221

2322
TOKEN_PATH = "~/.rcs/token.conf"

python/examples/fr3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
from rcs._core.hw import FR3Config, IKSolver
66
from rcs._core.sim import CameraType
77
from rcs.camera.sim import SimCameraConfig, SimCameraSet
8-
from rcs_fr3.desk import FCI, ContextManager, Desk, load_creds_fr3_desk
98
from rcs_fr3._core import hw
9+
from rcs_fr3.desk import FCI, ContextManager, Desk, load_creds_fr3_desk
1010

1111
import rcs
1212
from rcs import sim

src/pybind/rcs.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
#include "rcs/IK.h"
2-
#include "rcs/Pose.h"
3-
#include "rcs/Robot.h"
4-
#include "rcs/utils.h"
51
#include <pybind11/cast.h>
62
#include <pybind11/eigen.h>
73
#include <pybind11/operators.h>
@@ -14,6 +10,10 @@
1410

1511
#include <memory>
1612

13+
#include "rcs/IK.h"
14+
#include "rcs/Pose.h"
15+
#include "rcs/Robot.h"
16+
#include "rcs/utils.h"
1717
#include "rl/mdl/UrdfFactory.h"
1818

1919
// TODO: define exceptions
@@ -305,7 +305,6 @@ PYBIND11_MODULE(_core, m) {
305305
.def("reset", &rcs::common::Gripper::reset,
306306
py::call_guard<py::gil_scoped_release>());
307307

308-
309308
// SIM MODULE
310309
auto sim = m.def_submodule("sim", "sim module");
311310
py::class_<rcs::sim::SimRobotConfig, rcs::common::RobotConfig>(

0 commit comments

Comments
 (0)