⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mappath.h

📁 基于vc 的环境下机器人自主避障的算法 图形处理 具有载物功能
💻 H
字号:
//////////////////////////////////////////////////////////////////////
// MuRoS - Multi Robot Simulator
//
// Luiz Chaimowicz
// GRASP Lab. University of Pennsylvania
// VERLab - DCC - UFMG - Brasil
//
// MapPath.h: interface for the CMapPath class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(MAPPATH_H)
#define MAPPATH_H

#include "Afxtempl.h"
#include "obstacle.h"

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


class CMapPath : public CObject  
{
public:
    DECLARE_SERIAL( CMapPath )
	CMapPath();
	CMapPath(BOOL computeMap);
	CMapPath(const CMapPath *map, BOOL computeMap = FALSE);
	virtual ~CMapPath();

    void Serialize( CArchive& archive );
	void DeleteContents();


	void ComputePath();
	void ComputeMap();

	CPoint m_originReal;
	CPoint m_goalReal;

	CArray<CObstacle*, CObstacle*> m_obstacles;	// array with te obstacles in the environment
	CArray<CPoint, CPoint> m_path;				// array of points with the computed path of the robot

	BOOL m_isComputed;		// True if the grassfire map is currently computed
	BOOL m_computeMap;		// True if the map should be computed (dynamic variables shoul be allocated)

	// the path following must be improved*****
	float **m_line;			// lines to be followed by path follower controller based in the computed path
	int m_lineSize;			// size of this array
	int m_currentLine;		// current line that is been followed
	double m_oldDist;		// distance to the next line intersection
	BOOL m_setVelocity;		// flag to recompute robot's linear velocity.
	
	float m_maxValue;		// Maximum value in the grassfire map (used to compute the gray level of the pixels in the drwing)
	float **m_map;			// Computed Grassfire map

	static int m_sizeX;		// resolution of the grassfire map (matrix dimensions, etc)
	static int m_sizeY;
	static int m_resX;
	static int m_resY;
	static float m_cellDist;

private:
	void AllocateMaps();
	void FreeMaps();
	void InitFreeSpace();
	void GrassFire(float ** freespace, int freespaceX, int freespaceY, float distance, float ** navi);	
	
	float **m_freeSpace;		// initial state of the Grassfire map
};


#endif 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -