#include "map_handling.h"
#include <string.h>
#include "actuators.h"
+#include "corns_configs.h"
+#include <robodim.h>
#ifdef ROBOT_DEBUG
#define DBG(format, ...) printf(format, ##__VA_ARGS__)
void fill_in_known_areas_in_map()
{
/* Do not plan path close to edges */
- //ShmapSetRectangleFlag(0.0, 0.0, 0.199, 2.1, MAP_FLAG_WALL, 0); /* left */
- //ShmapSetRectangleFlag(0.0, 0.0, 3.0, 0.199, MAP_FLAG_WALL, 0); /* bottom */
- //ShmapSetRectangleFlag(0.0, 1.901, 3.0, 2.1, MAP_FLAG_WALL, 0); /* top */
- //ShmapSetRectangleFlag(2.801, 0.0, 3.0, 2.1, MAP_FLAG_WALL, 0); /* right */
+ ShmapSetRectangleFlag(0.0, 0.0, 0.26, 2.1, MAP_FLAG_WALL, 0); /* left */
+ ShmapSetRectangleFlag(0.0, 0.0, 3.0, 0.26, MAP_FLAG_WALL, 0); /* bottom */
+ ShmapSetRectangleFlag(0.0, 1.84, 3.0, 2.1, MAP_FLAG_WALL, 0); /* top */
+ ShmapSetRectangleFlag(2.74, 0.0, 3.0, 2.1, MAP_FLAG_WALL, 0); /* right */
+
+ /* Container surroundings */
+ ShmapSetRectangleFlag(0.0, 0.0, 0.4, 0.2, 0, MAP_FLAG_WALL); /* left container */
+ ShmapSetRectangleFlag(3.0, 0.0, 2.6, 0.2, 0, MAP_FLAG_WALL); /* right container */
/* Ignore other obstacles at edges */
//ShmapSetRectangleFlag(0.0, 0.0, 0.09, 2.1, MAP_FLAG_IGNORE_OBST, 0); /* left */
//ShmapSetRectangleFlag(0.0, 2.01, 3.0, 2.1, MAP_FLAG_IGNORE_OBST, 0); /* top */
//ShmapSetRectangleFlag(2.91, 0.0, 3.0, 2.1, MAP_FLAG_IGNORE_OBST, 0); /* right */
- ShmapSetRectangleFlag(0.74, 1.6, 2.259, 2.1, MAP_FLAG_WALL, 0); /* plateau, slopes */
-
+ ShmapSetRectangleFlag(0.6, 1.45, 2.45, 2.1, MAP_FLAG_WALL, 0); /* plateau, slopes */
+
+ /* corns */
+ struct corns_group *corns = get_all_corns(0, 0);
+ struct corn * corn;
+ for(corn = corns->corns; corn < &corns->corns[corns->corns_count]; corn++) {
+ printf("drawing corn at %.3f, %.3f with radius of %.3f\n", corn->position.x, corn->position.y, CORN_NEIGHBOURHOOD_RADIUS_M);
+ ShmapSetCircleFlag(corn->position.x, corn->position.y, CORN_NEIGHBOURHOOD_RADIUS_M, MAP_FLAG_WALL, 0);
+ }
+ dispose_corns_group(corns); // robot.corns will be set later, when the corns' configuration is known
}
static void trans_callback(struct robo_fsm *fsm)