Skip to content

Commit

Permalink
Cambiamos nombre de parámetros y origen en componente BOX
Browse files Browse the repository at this point in the history
  • Loading branch information
titos-carrasco committed Jun 16, 2021
1 parent b22b2c3 commit 25b4a2c
Show file tree
Hide file tree
Showing 9 changed files with 1,972,307 additions and 25 deletions.
9 changes: 9 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# ChangeLog

## @v.1.1.1 - 2021-06-15

### Changed
- Renombramos parámetros l1 y l2 de la definición del elemento BOX
- Cambiamos interpretación de origen (x,y) en componente BOX. Pasa de (center, center) a (left, bottom)


## @v.1.1.0 - 2021-06-12

### Changed
- Migramos a jsoncpp
- Corrige primera linea del protocolo para manejarla en formato json


## @v1.0.1 2021-06-11

### Added
Expand All @@ -14,6 +22,7 @@
### Fixed
- Corrige timeout en socket


## @@ - 2021-06-09

### Fixed
Expand Down
12 changes: 6 additions & 6 deletions cpp_server/src/RobotWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,16 @@ RobotWorld::RobotWorld( std::string world_file_name ) :

double x = entry.get( "x", -1 ).asDouble();
double y = entry.get( "y", -1 ).asDouble();
double l1 = entry.get( "l1", -1 ).asDouble();
double l2 = entry.get( "l2", -1 ).asDouble();
double sizex = entry.get( "sizex", -1 ).asDouble();
double sizey = entry.get( "sizey", -1 ).asDouble();
double height = entry.get( "height", -1 ).asDouble();
double mass = entry.get( "mass", -2 ).asDouble();
std::string color = entry.get( "color", "_UNDEF_" ).asString();

if( x < 0 ||
y < 0 ||
l1 <= 0 ||
l2 <= 0 ||
sizex <= 0 ||
sizey <= 0 ||
height <= 0 ||
mass <= -2 ||
color.compare( "_UNDEF_" ) == 0 )
Expand All @@ -191,9 +191,9 @@ RobotWorld::RobotWorld( std::string world_file_name ) :
{

Enki::PhysicalObject* o = new Enki::PhysicalObject();
o->setRectangular( l1, l2, height, mass );
o->setRectangular( sizex, sizey, height, mass );
o->setColor( colors[ color ] );
o->pos = Enki::Point( x, y );
o->pos = Enki::Point( x + sizex/2, y + sizey/2 );
o->angle = entry.get( "angle", .0 ).asDouble()*(M_PI/180.0);
world->addObject( o );
}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

SETUP = {
"name" : "robworld",
"version" : "1.1.0",
"version" : "1.1.1",
"description" : "Control de robots en el mundo de robots",
"license" : "MIT",
"author" : "Roberto Carrasco",
Expand Down
4 changes: 2 additions & 2 deletions test/worlds/epuck.world
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

{ "type":"world", "width":100, "height":100, "walls":5, "color":"gray", "ground": "", "host":"", "port":44444 },

{ "type":"box", "x":50, "y":69, "l1":38, "l2":2, "height":10, "mass":1000, "color":"red" },
{ "type":"box", "x":32, "y":68, "sizex":38, "sizey":2, "height":10, "mass":1000, "color":"red" },
{ "type":"cylinder", "x":15, "y":50, "radius":3, "height":10, "mass":1000, "color":"green" },
{ "type":"box", "x":50, "y":20, "l1":38, "l2":2, "height":10, "mass":1000, "color":"blue" },
{ "type":"box", "x":32, "y":30, "sizex":38, "sizey":2, "height":10, "mass":1000, "color":"blue" },

{ "type":"epuck", "name":"Epuck-01", "x":50, "y":50, "angle":0 }
]
8 changes: 4 additions & 4 deletions test/worlds/marxbot.world
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

{ "type":"world", "width":100, "height":100, "walls": 5, "color":"gray", "ground": "sumo.ppm", "host":"", "port":44444 },

{ "type":"box", "x":30, "y":50, "l1":2, "l2":40, "height":10, "mass":-1, "color":"green" },
{ "type":"box", "x":70, "y":50, "l1":2, "l2":40, "height":10, "mass":1000, "color":"blue" },
{ "type":"box", "x":50, "y":31, "l1":38, "l2":2, "height":10, "mass":1000, "color":"red" },
{ "type":"box", "x":50, "y":69, "l1":38, "l2":2, "height":10, "mass":1000, "color":"gray" },
{ "type":"box", "x":30, "y":30, "sizex":2, "sizey":40, "height":10, "mass":-1, "color":"green" },
{ "type":"box", "x":70, "y":30, "sizex":2, "sizey":40, "height":10, "mass":1000, "color":"blue" },
{ "type":"box", "x":32, "y":30, "sizex":38, "sizey":2, "height":10, "mass":1000, "color":"red" },
{ "type":"box", "x":32, "y":68, "sizex":38, "sizey":2, "height":10, "mass":1000, "color":"gray" },
{ "type":"cylinder", "x":15, "y":50, "radius":3, "height":10, "mass":1000, "color":"gray" },

{ "type":"marxbot", "name":"Marxbot-01", "x":50, "y":50, "angle":0 }
Expand Down
Loading

0 comments on commit 25b4a2c

Please sign in to comment.