Demo entry 6333724

mapping

   

Submitted by anonymous on Dec 04, 2016 at 16:38
Language: C. Code size: 993 Bytes.

/* Task init */
	#ifdef DEBUG
		//uint8_t uintuxHighWaterMark = uxTaskGetStackHighWaterMark( NULL );
		printf("Mapping OK\n");
	#endif
	
	// Initialize map
	uint8_t grid[MAP_HEIGHT][MAP_WIDTH / CELLS_PER_COL];
	for (int16_t i = 0; i < MAP_HEIGHT; i++) {
		for (int16_t j = 0; j < MAP_WIDTH / CELLS_PER_COL; j++) {
			grid[i][j] = 0b10101010; // Each cell initialized to 2
		}
	}

	Update_t Update = { 0 };
	Pose_t RobotPose = { 0 };
	Sensor_t Sensors[NUMBER_OF_SENSORS] = { 0 };
	int16_t irHeading[NUMBER_OF_SENSORS] = { 0 };
	int16_t irData[NUMBER_OF_SENSORS] = { 0 };
	Position_t RobotPosition = { 0 };
		
	// Initialize the xLastWakeTime variable with the current time.
	//TickType_t xLastWakeTime;
	
	// Testing
	Map_Location_t m1 = { .row = 50, .column = 50 };
	Map_Location_t m2 = { .row = 25, .column = 25 };
	Map_Location_t m3 = { .row = 50, .column = 80 };
	Map_Location_t m4 = { .row = 99, .column = 0 };
	Map_Location_t m5 = { .row = -5, .column = -5 };

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).