Skip to content

Commit

Permalink
Deskew the scans by default (#432)
Browse files Browse the repository at this point in the history
* Remove --deskew as a cli option. Generate a warning to advertise this to
the user

* Restruct string

* Change print message

* Fix black

* Minor fix

---------

Co-authored-by: Benedikt Mersch <benedikt.mersch@gmail.com>
  • Loading branch information
tizianoGuadagnino and benemer authored Jan 27, 2025
1 parent 922c779 commit a2b8f13
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
9 changes: 1 addition & 8 deletions python/kiss_icp/config/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,10 @@ def _yaml_source(config_file: Optional[Path]) -> Dict[str, Any]:
return data or {}


def load_config(
config_file: Optional[Path], deskew: Optional[bool], max_range: Optional[float]
) -> KISSConfig:
"""Load configuration from an Optional yaml file. Additionally, deskew and max_range can be
also specified from the CLI interface"""

def load_config(config_file: Optional[Path], max_range: Optional[float]) -> KISSConfig:
config = KISSConfig(**_yaml_source(config_file))

# Override defaults from command line
if deskew is not None:
config.data.deskew = deskew
if max_range is not None:
config.data.max_range = max_range

Expand Down
3 changes: 1 addition & 2 deletions python/kiss_icp/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def __init__(
self,
dataset,
config: Optional[Path] = None,
deskew: Optional[bool] = False,
max_range: Optional[float] = None,
visualize: bool = False,
n_scans: int = -1,
Expand All @@ -58,7 +57,7 @@ def __init__(
self._last = self._jump + self._n_scans

# Config and output dir
self.config = load_config(config, deskew=deskew, max_range=max_range)
self.config = load_config(config, max_range=max_range)
self.results_dir = None

# Pipeline
Expand Down
12 changes: 9 additions & 3 deletions python/kiss_icp/tools/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def kiss_icp_pipeline(
is_flag=True,
help="[Optional] Whether or not to deskew the scan or not",
),
# Aditional Options ---------------------------------------------------------------------------
# Additional Options ---------------------------------------------------------------------------
visualize: bool = typer.Option(
False,
"--visualize",
Expand Down Expand Up @@ -225,7 +225,14 @@ def kiss_icp_pipeline(
print(f"[WARNING] '{dataloader}' does not support '--jump', starting from first frame")
jump = 0

# Lazy-loading for faster CLI
print(
f"[WARNING] KISS-ICP now deskews the scans by default. If you want to change this behaviour create and edit a configuration file using 'kiss_icp_dump_config'. Then run using --config <your_config>."
)
if deskew:
print(
f"[WARNING] The option '--deskew' is deprecated and might be removed in future versions."
)

from kiss_icp.datasets import dataset_factory
from kiss_icp.pipeline import OdometryPipeline

Expand All @@ -239,7 +246,6 @@ def kiss_icp_pipeline(
meta=meta,
),
config=config,
deskew=deskew,
max_range=max_range,
visualize=visualize,
n_scans=n_scans,
Expand Down

0 comments on commit a2b8f13

Please sign in to comment.