Skip to content

Commit

Permalink
Rename package to ROSE
Browse files Browse the repository at this point in the history
  • Loading branch information
contagon committed May 24, 2024
1 parent dbf8e33 commit cfefbc9
Show file tree
Hide file tree
Showing 38 changed files with 148 additions and 137 deletions.
2 changes: 1 addition & 1 deletion .conda_config
Original file line number Diff line number Diff line change
@@ -1 +1 @@
wheel2
rose
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#################### BASIC SETUP ####################
cmake_minimum_required(VERSION 3.16)
project(RobustVIO VERSION 0.1 LANGUAGES CXX)
project(ROSE VERSION 0.1 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)

Expand Down
2 changes: 1 addition & 1 deletion exe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ cmake_minimum_required(VERSION 3.16)

#################### ADD EXECUTABLES ####################
add_executable(experiment experiment.cpp)
target_link_libraries(experiment PRIVATE robust gtsam jrl ${Boost_LIBRARIES})
target_link_libraries(experiment PRIVATE rose gtsam jrl ${Boost_LIBRARIES})
4 changes: 2 additions & 2 deletions exe/experiment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ po::variables_map handle_args(int argc, const char *argv[]) {

// Handle help special case
if (var_map.count("help") || argc == 1) {
std::cout << "run-experiment: Main entry point to run robust VIO methods on JRL datasets. Please provide "
std::cout << "run-experiment: Main entry point to run rose methods on JRL datasets. Please provide "
"required arguments: "
<< std::endl;
std::cout << options << "\n";
Expand Down Expand Up @@ -142,7 +142,7 @@ int main(int argc, const char *argv[]) {

// Load in data
bool use_cbor = (data_path.find("cbor") != std::string::npos);
jrl::Parser parser = makeRobustParser();
jrl::Parser parser = makeRoseParser();
jrl::Dataset dataset = parser.parseDataset(data_path, use_cbor);

// Make backend
Expand Down
12 changes: 6 additions & 6 deletions figures/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import matplotlib.pyplot as plt
import numpy as np
import rasterio
import robust.jrl
import robust.plot as plot
import rose.jrl
import rose.plot as plot
import seaborn as sns
from rasterio.warp import Resampling, calculate_default_transform, reproject
from robust.dataset import Dataset2JRL, Sensor
from robust.flat import FlatDataset
from robust.sabercat import SabercatBag
from rose.dataset import Dataset2JRL, Sensor
from rose.flat import FlatDataset
from rose.sabercat import SabercatBag

if __name__ == "__main__":
traj = "all_2024-02-09-14-08-29"
Expand Down Expand Up @@ -71,7 +71,7 @@
results = {}
for name, filename in types.items():
values = (
robust.jrl.makeRobustParser()
rose.jrl.makeRoseParser()
.parseResults(str(RESULTS / filename), False)
.robot_solutions["a"]
.values
Expand Down
4 changes: 2 additions & 2 deletions figures/monte_carlo.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import robust.plot as plot
import rose.plot as plot
import seaborn as sns
from robust.robust_python import (
from rose.rose_python import (
WheelCovIntrSlipTag,
WheelCovSlipTag,
WheelCovTag,
Expand Down
6 changes: 3 additions & 3 deletions figures/sabercat_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import robust.jrl
import robust.plot as plot
import rose.jrl
import rose.plot as plot
import seaborn as sns
from gtsam.symbol_shorthand import X
from tabulate import tabulate
Expand Down Expand Up @@ -50,7 +50,7 @@ def compute_traj_length(values: gtsam.Values):
args = parser.parse_args()

# ------------------------- Load gt values ------------------------- #
jrl_parser = robust.jrl.makeRobustParser()
jrl_parser = rose.jrl.makeRoseParser()

trajs = {}

Expand Down
8 changes: 4 additions & 4 deletions figures/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import jrl
import matplotlib.pyplot as plt
import robust.jrl
import robust.plot as plot
import rose.jrl
import rose.plot as plot
import seaborn as sns
from matplotlib.patches import ConnectionPatch, Rectangle
from mpl_toolkits.axes_grid1.inset_locator import mark_inset
from robust.robust_python import WheelCovIntrSlipTag
from rose.rose_python import WheelCovIntrSlipTag


# https://stackoverflow.com/a/73308476
Expand Down Expand Up @@ -43,7 +43,7 @@ def indicate_inset(axin, axout, arrow_start=(0, 0), arrow_end=(0, 0)):
# ------------------------- Load all data ------------------------- #
tags_to_names = plot.tags_to_names()
result_files = [p for p in Path("figures/data").glob("*.jrr")]
jrl_parser = robust.jrl.makeRobustParser()
jrl_parser = rose.jrl.makeRoseParser()

results = {}
for p in result_files:
Expand Down
12 changes: 6 additions & 6 deletions figures/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import robust.plot
import rose.plot
import seaborn as sns
import sympy as sy
from gtsam.symbol_shorthand import B, I, L, S
from robust.dataset import Dataset2JRL, Sensor, WheelNoise
from robust.sim import SimParameters, Simulation, symp
from rose.dataset import Dataset2JRL, Sensor, WheelNoise
from rose.sim import SimParameters, Simulation, symp
from tabulate import tabulate
from tqdm import tqdm, trange

Expand Down Expand Up @@ -45,8 +45,8 @@ def compute_traj_length(values: gtsam.Values):
gt = dataset.get_ground_truth()

# ------------------------- Plot 3D Grid ------------------------- #
c = robust.plot.setup_plot()
state = robust.plot.load_full_state(gt, dataset.N, pandas=False)
c = rose.plot.setup_plot()
state = rose.plot.load_full_state(gt, dataset.N, pandas=False)

# Load data
x = np.linspace(-5, state[:, 3].max() + 5)
Expand Down Expand Up @@ -75,7 +75,7 @@ def compute_traj_length(values: gtsam.Values):
lw=0.01,
cmap=sns.color_palette("crest", as_cmap=True),
)
black = c[robust.plot.WheelType.GT.value]
black = c[rose.plot.WheelType.GT.value]
ax.plot(state[:, 3], state[:, 4], state[:, 5] - minZ, lw=3, c=black)

# This changes the aspect ratio by changing the axis-box size (rather than just the limits)
Expand Down
2 changes: 1 addition & 1 deletion figures/tukey.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from robust.plot import setup_plot
from rose.plot import setup_plot

c = setup_plot()
c = sns.color_palette("colorblind")
Expand Down
4 changes: 2 additions & 2 deletions include/backend/JRL.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
static const std::string PriorFactorIntrinsicsTag = "PriorFactorIntrinsics";

// ------------------------- Register Custom Options ------------------------- //
inline jrl::Parser makeRobustParser() {
inline jrl::Parser makeRoseParser() {
jrl::Parser parser;

// clang-format off
Expand All @@ -35,7 +35,7 @@ inline jrl::Parser makeRobustParser() {
return parser;
}

inline jrl::Writer makeRobustWriter() {
inline jrl::Writer makeRoseWriter() {
jrl::Writer writer;

// clang-format off
Expand Down
20 changes: 10 additions & 10 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,33 @@ set(PYTHON_BUILD_DIRECTORY ${PROJECT_BINARY_DIR}/python)
# TODO: README?
configure_file(${PROJECT_SOURCE_DIR}/python/setup.py.in
${PYTHON_BUILD_DIRECTORY}/setup.py)
create_symlinks("${CMAKE_CURRENT_SOURCE_DIR}/robust" "${PYTHON_BUILD_DIRECTORY}/robust")
create_symlinks("${CMAKE_CURRENT_SOURCE_DIR}/rose" "${PYTHON_BUILD_DIRECTORY}/rose")

# ------------------------- Setup pybind target ------------------------- #
pybind11_add_module(robust_python bindings.cpp)
target_link_libraries(robust_python PUBLIC robust)
target_include_directories(robust_python PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
pybind11_add_module(rose_python bindings.cpp)
target_link_libraries(rose_python PUBLIC rose)
target_include_directories(rose_python PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")

set_target_properties(robust_python PROPERTIES
set_target_properties(rose_python PROPERTIES
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib"
INSTALL_RPATH_USE_LINK_PATH TRUE
OUTPUT_NAME "robust_python"
LIBRARY_OUTPUT_DIRECTORY "${PYTHON_BUILD_DIRECTORY}/robust"
OUTPUT_NAME "rose_python"
LIBRARY_OUTPUT_DIRECTORY "${PYTHON_BUILD_DIRECTORY}/rose"
DEBUG_POSTFIX "" # Otherwise you will have a wrong name
RELWITHDEBINFO_POSTFIX "" # Otherwise you will have a wrong name
)
target_compile_features(robust_python PUBLIC cxx_std_17)
target_compile_features(rose_python PUBLIC cxx_std_17)

# ------------------------- Setup Python install instructions ------------------------- #

# Setup the install command. Simply delegates to pip (should work with environmets)
find_package(Python COMPONENTS Interpreter Development REQUIRED)
add_custom_target(python-install
COMMAND ${Python_EXECUTABLE} -m pip install -e .
DEPENDS robust_python
DEPENDS rose_python
WORKING_DIRECTORY ${JRL_PYTHON_BUILD_DIRECTORY})

# Setup uninstall command. This can also be done with pip
add_custom_target(python-uninstall
COMMAND pip uninstall robust
COMMAND pip uninstall rose
WORKING_DIRECTORY ${JRL_PYTHON_BUILD_DIRECTORY})
6 changes: 3 additions & 3 deletions python/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ using namespace pybind11::literals;
PYBIND11_DECLARE_HOLDER_TYPE(TYPE_PLACEHOLDER_DONOTUSE, boost::shared_ptr<TYPE_PLACEHOLDER_DONOTUSE>);
PYBIND11_DECLARE_HOLDER_TYPE(TYPE_PLACEHOLDER_DONOTUSE, std::shared_ptr<TYPE_PLACEHOLDER_DONOTUSE>);

PYBIND11_MODULE(robust_python, m) {
PYBIND11_MODULE(rose_python, m) {
// Import gtsam to ensure that python has access to return types
py::module gtsam = py::module::import("gtsam");
py::module jrl = py::module::import("jrl");
Expand All @@ -34,8 +34,8 @@ PYBIND11_MODULE(robust_python, m) {
m.attr("PlanarPriorTag") = py::str(PlanarPriorTag);
m.attr("ZPriorTag") = py::str(ZPriorTag);

m.def("makeRobustParser", makeRobustParser);
m.def("makeRobustWriter", makeRobustWriter);
m.def("makeRoseParser", makeRoseParser);
m.def("makeRoseWriter", makeRoseWriter);

// ------------------------- Frontend ------------------------- //
py::class_<JRLFrontend, boost::shared_ptr<JRLFrontend>>(m, "JRLFrontend")
Expand Down
5 changes: 0 additions & 5 deletions python/robust/__init__.py

This file was deleted.

4 changes: 4 additions & 0 deletions python/rose/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .datasets.flat import FlatDataset
from .datasets.grizzly import GrizzlyBag
from .datasets.sabercat import SabercatBag
from .datasets.kaist import KaistDataset
12 changes: 6 additions & 6 deletions python/robust/dataset.py → python/rose/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
import numpy as np
import yaml
from gtsam.symbol_shorthand import B, I, L, M, S, V, W, X
from robust.jrl import (
makeRobustParser,
makeRobustWriter,
from rose.jrl import (
makeRoseParser,
makeRoseWriter,
values2results,
values2typedvalues,
)
from robust.robust_python import (
from rose.rose_python import (
PlanarPriorFactor,
PlanarPriorTag,
PreintegratedWheelCov,
Expand Down Expand Up @@ -703,8 +703,8 @@ def __init__(self, data: Dataset, N: int = None) -> None:
Sensor.FEAT: self._feat_factor,
}

self.writer = makeRobustWriter()
self.parser = makeRobustParser()
self.writer = makeRoseWriter()
self.parser = makeRoseParser()

# Things that should be updated as we go
self.traj = {}
Expand Down
4 changes: 2 additions & 2 deletions python/robust/flat.py → python/rose/datasets/flat.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import gtsam
import numpy as np
import yaml
from robust.dataset import (
from rose.dataset import (
BaseData,
BaseIntrinsics,
BaseNoise,
Expand All @@ -26,7 +26,7 @@
WheelIntrinsics,
WheelNoise,
)
from robust.robust_python import PreintegratedWheelParams
from rose.rose_python import PreintegratedWheelParams


class FlatDataset(Dataset):
Expand Down
8 changes: 7 additions & 1 deletion python/robust/grizzly.py → python/rose/datasets/grizzly.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
import yourdfpy
from cv_bridge import CvBridge

from .dataset import CameraIntrinsics, CamNoise, IMUNoise, WheelIntrinsics, WheelNoise
from rose.dataset import (
CameraIntrinsics,
CamNoise,
IMUNoise,
WheelIntrinsics,
WheelNoise,
)

URDF_DIR = os.environ["URDF_DIR"]
SCALE = 672 / 5376
Expand Down
8 changes: 3 additions & 5 deletions python/robust/kaist.py → python/rose/datasets/kaist.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import cv2
import gtsam
import numpy as np
from robust.dataset import (
from rose.dataset import (
BaseIntrinsics,
BaseNoise,
CameraData,
Expand All @@ -22,7 +22,7 @@
WheelIntrinsics,
WheelNoise,
)
from robust.robust_python import PreintegratedWheelParams
from rose.rose_python import PreintegratedWheelParams

# https://www.xsens.com/hubfs/Downloads/Leaflets/MTi-300.pdf
SIGMA_A = 60 * (1 / 10**6) * (1 / 9.81)
Expand Down Expand Up @@ -251,9 +251,7 @@ def data(self, sensor: Sensor) -> Union[IMUData, CameraData, GTData, WheelData]:
)

@functools.cache
def noise(
self, sensor: Sensor
) -> Union[
def noise(self, sensor: Sensor) -> Union[
gtsam.PreintegratedCombinedMeasurements,
gtsam.noiseModel.Base,
PreintegratedWheelParams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import yourdfpy
from cv_bridge import CvBridge

from .dataset import (
from rose.dataset import (
CameraIntrinsics,
CamNoise,
IMUNoise,
Expand Down
6 changes: 3 additions & 3 deletions python/robust/jrl.py → python/rose/jrl.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import gtsam
import jrl

# ------------------------- Import according cpp helpers as well ------------------------- #
from robust.robust_python import makeRobustParser, makeRobustWriter


# ------------------------- Helpers for Wrapping GTSAM containers ------------------------- #
from rose.rose_python import makeRoseParser, makeRoseWriter


def values2results(
values: gtsam.Values, name: str = "", dataset: str = ""
) -> jrl.Results:
Expand Down
2 changes: 1 addition & 1 deletion python/robust/plot.py → python/rose/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import seaborn as sns
from gtsam.symbol_shorthand import B, I, M, S, V, X
from matplotlib.lines import Line2D
from robust.robust_python import WheelCovIntrSlipTag, WheelCovTag, WheelDangTag
from rose.rose_python import WheelCovIntrSlipTag, WheelCovTag, WheelDangTag


# https://stackoverflow.com/a/43343934
Expand Down
2 changes: 1 addition & 1 deletion python/robust/sim.py → python/rose/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import sympy as sy
from gtsam.symbol_shorthand import L, M, X
from gtsam.utils.plot import set_axes_equal
from robust.dataset import (
from rose.dataset import (
CameraData,
CamNoise,
FeatData,
Expand Down
Loading

0 comments on commit cfefbc9

Please sign in to comment.