Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simple command costmap api - first few functions #3159

Merged
merged 5 commits into from
Aug 31, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions nav2_simple_commander/nav2_simple_commander/costmap_2d.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#! /usr/bin/env python3
SteveMacenski marked this conversation as resolved.
Show resolved Hide resolved
from nav_msgs.msg import OccupancyGrid
import numpy as np

class PyCostmap2D:
def __init__(self, map):
self.size_x_ = map.info.width;
self.size_y_ = map.info.height;
self.resolution_ = map.info.resolution;
self.origin_x_ = map.info.origin.position.x;
self.origin_y_ = map.info.origin.position.y;
self.costmap_ = np.array(msg.data, dtype=np.int8).reshape(self.size_y_, self.size_x_)
def getSizeinMetersX(self):
...
def getSizeInCellsY(self):
...
def getSizeInMetersX(self):
...
def getOriginX(self):
...
def getOriginY(self):
...
def getResolution(self):
...
def getGlobalFrameID(self):
...
SteveMacenski marked this conversation as resolved.
Show resolved Hide resolved
def getCostmapTimestamp(self):
...