programmablematterproject / visiblesim Goto Github PK
View Code? Open in Web Editor NEWVisibleSim is a simulator of networked modular robots.
Home Page: https://www.programmable-matter.com/simulation
License: Other
VisibleSim is a simulator of networked modular robots.
Home Page: https://www.programmable-matter.com/simulation
License: Other
Hi!
I found a bug at module insertion function in context menu.
Module can be inserted even if clicking non connector portion.
Note: This may not be happen depending on memory state.
Video:
https://www.youtube.com/watch?v=l8awqUfgwUA&ab_channel=TEMMIEHOIHOI
config.xml
<?xml version="1.0" standalone="no" ?>
<world gridSize="5,5,5">
<blockList blockSize="10,10,10">
<block position="1,1,1" color="255,140,0" orientation="3" />
</blockList>
</world>
Set a value({0, 0, 0}) when clicking non connector portion to tabConnectorPositions.
In my view, the reason is that tabConnectorPositions doesn't have argument corresponding to non-connector spot.
This caused a buffer overrun, which resulted in an incorrect value for realPos.
Following is log of that time.
Thread 1 "myMotionTest" hit Breakpoint 1, Catoms3D::Catoms3DBlock::getNeighborPos (this=0xe15c8980, connectorID=56 '8', pos=...) at robots/catoms3D/catoms3DBlock.cpp:160
160 bool Catoms3DBlock::getNeighborPos(uint8_t connectorID, Cell3DPosition &pos) const {
(gdb) n
161 Vector3D realPos;
(gdb) n
163 Catoms3DWorld *wrl = getWorld();
(gdb) n
164 const Vector3D bs = wrl->lattice->gridScale;
(gdb) n
166 realPos.set(tabConnectorPositions[connectorID], 3, 1);
(gdb) p bs
$4 = {_pt = {10, 10, 10, 0}}
(gdb) n
167 realPos *= bs;
(gdb) p realPos
$5 = {_pt = {0.000748447317, 7.13885687e+31, 5.66773757e-08, 1}}
(gdb) n
168 realPos.set(3,1.0); // A vérifier
(gdb) p realPos
$6 = {_pt = {0.00748447329, 7.13885668e+32, 5.66773735e-07, 0}}
(gdb) n
169 realPos = ((Catoms3DGlBlock *) ptrGlBlock)->mat * realPos;
(gdb) p realPos
$7 = {_pt = {0.00748447329, 7.13885668e+32, 5.66773735e-07, 1}}
(gdb) n
170 if (realPos[2] < 0) return false;
(gdb) p realPos
$8 = {_pt = {3.56942795e+32, 3.56942795e+32, -5.04793378e+32, 1}}
When running the simulation it would be great to have some control over the mechanics of the execution. Specifically, I am referring to two items here: playback speed, and the ability to reset. In terms of playback speed it would be nice to have some variability here to better visualize what is happening in the simulation. I suppose you could capture and export a video and then watch it with the desired speed there, but that seems like an unnecessary step. The ability to reset would just be a feature allowing the user to reset the simulation from the GUI. Currently, one has to close the program and restart to achieve this.
Great software! I just wanted to offer a few suggestions based on what I would have liked to be able to do while running a simulation.
Hi!
I found locked module can rotate. This seems to be bug, so could you check it?
Motion Video
https://youtu.be/Dv6QnyKQxTg
VisibleSim Version
VS2022.3.1
myMotionTestCode.cpp
#include "myMotionTestCode.hpp"
MyMotionTestCode::MyMotionTestCode(Catoms3DBlock *host) : Catoms3DBlockCode(host), module(host)
{
// @warning Do not remove block below, as a blockcode with a NULL host might be created
// for command line parsing
if (not host)
return;
}
void MyMotionTestCode::startup()
{
console << "start " << module->blockId << "\n";
if (module->blockId == 11)
{ // Master id is 1
module->setColor(RED);
Cell3DPosition target_pos = module->position + Cell3DPosition(1, 1, 1);
module->moveTo(target_pos);
// console << "canMoveto " << target_pos << " from " << module->position << " is "<< module->canMoveTo(target_pos) << "\n";
}
}
#ifndef myMotionTestCode_H_
#define myMotionTestCode_H_
#include "robots/catoms3D/catoms3DSimulator.h"
#include "robots/catoms3D/catoms3DWorld.h"
#include "robots/catoms3D/catoms3DBlockCode.h"
using namespace Catoms3D;
class MyMotionTestCode : public Catoms3DBlockCode {
private:
Catoms3DBlock *module = nullptr;
public :
MyMotionTestCode(Catoms3DBlock *host);
~MyMotionTestCode() {};
Cell3DPosition targetPos;
/**
* This function is called on startup of the blockCode, it can be used to perform initial
* configuration of the host or this instance of the program.
* @note this can be thought of as the main function of the module
*/
void startup() override;
/*****************************************************************************/
/** needed to associate code to module **/
static BlockCode *buildNewBlockCode(BuildingBlock *host) {
return(new MyMotionTestCode((Catoms3DBlock*)host));
}
/*****************************************************************************/
};
#endif /* myMotionTestCode_H_ */
<?xml version="1.0" standalone="no" ?>
<world gridSize="26,26,26" visual="1024,800">
<camera target="54.5554,56.3875,22.0596" directionSpherical="-2561.64,33.8501,220" angle="45.000000" near="0.100000" far="2000.000000" />
<spotlight target="0,0,0" directionSpherical="135,80,800" angle="43.152390" />
<blockList blockSize="10,10,10">
<block position="5,5,0" color="255,140,0" orientation="0" />
<block position="5,6,0" color="255,140,0" orientation="0" />
<block position="6,6,0" color="255,140,0" orientation="0" />
<block position="6,5,0" color="255,140,0" orientation="0" />
<block position="6,5,1" color="255,140,0" orientation="0" />
<block position="6,4,1" color="255,140,0" orientation="0" />
<block position="6,6,1" color="255,140,0" orientation="0" />
<block position="5,6,1" color="255,140,0" orientation="0" />
<block position="4,6,1" color="255,140,0" orientation="0" />
<block position="4,5,1" color="255,140,0" orientation="0" />
<block position="5,5,1" color="255,140,0" orientation="0" />
</blockList>
</world>
Hi!
I found module motion that seems to be not allowed.
Could you check it?
Motion Video
https://youtu.be/shIH0Xp4t4s
VisibleSim Version
VS2022.3.1
myMotionTestCode.cpp
#include "myMotionTestCode.hpp"
MyMotionTestCode::MyMotionTestCode(Catoms3DBlock *host) : Catoms3DBlockCode(host), module(host)
{
// @warning Do not remove block below, as a blockcode with a NULL host might be created
// for command line parsing
if (not host)
return;
}
void MyMotionTestCode::startup()
{
console << "start " << module->blockId << "\n";
if (module->blockId == 2)
{
module->setColor(RED);
Cell3DPosition target_pos = module->position + Cell3DPosition(1, 1, -1);
module->moveTo(target_pos);
}else if(module->blockId == 3){
module->setColor(RED);
Cell3DPosition target_pos = module->position + Cell3DPosition(0, 1, -1);
module->moveTo(target_pos);
}
}
#ifndef myMotionTestCode_H_
#define myMotionTestCode_H_
#include "robots/catoms3D/catoms3DSimulator.h"
#include "robots/catoms3D/catoms3DWorld.h"
#include "robots/catoms3D/catoms3DBlockCode.h"
#include "robots/catoms3D/catoms3DMotionEngine.h"
#include "robots/catoms3D/catoms3DRotationEvents.h"
using namespace Catoms3D;
class MyMotionTestCode : public Catoms3DBlockCode {
private:
Catoms3DBlock *module = nullptr;
public :
MyMotionTestCode(Catoms3DBlock *host);
~MyMotionTestCode() {};
Cell3DPosition targetPos;
/**
* This function is called on startup of the blockCode, it can be used to perform initial
* configuration of the host or this instance of the program.
* @note this can be thought of as the main function of the module
*/
void startup() override;
/*****************************************************************************/
/** needed to associate code to module **/
static BlockCode *buildNewBlockCode(BuildingBlock *host) {
return(new MyMotionTestCode((Catoms3DBlock*)host));
}
/*****************************************************************************/
};
#endif /* myMotionTestCode_H_ */
#include <iostream>
#include "myMotionTestCode.hpp"
using namespace std;
using namespace Catoms3D;
int main(int argc, char **argv) {
try {
createSimulator(argc, argv, MyMotionTestCode::buildNewBlockCode);
getSimulator()->printInfo();
BaseSimulator::getWorld()->printInfo();
deleteSimulator();
} catch(std::exception const& e) {
cerr << "Uncaught exception: " << e.what();
}
return 0;
}
config.xml
<?xml version="1.0" standalone="no" ?>
<world gridSize="26,26,26" visual="1024,800">
<camera target="54.5554,56.3875,22.0596" directionSpherical="-2561.64,33.8501,220" angle="45.000000" near="0.100000" far="2000.000000" />
<spotlight target="0,0,0" directionSpherical="135,80,800" angle="43.152390" />
<blockList blockSize="10,10,10">
<block position="5,5,0" color="255,140,0" orientation="0" />
<block position="5,4,1" color="255,140,0" orientation="0" />
<block position="7,4,1" color="255,140,0" orientation="0" />
<block position="8,5,0" color="255,140,0" orientation="0" />
</blockList>
</world>
Hi!
I found a behavior that seems to be a violation of the motion constraint.
A motion like "Figure 1: 3D Catom rotation and motion constraints." seems to be forbidden but can do on VisibleSim.
Is this a bug?
https://projects.femto-st.fr/programmable-matter/massively-parallel-self-reconfiguration
Motion Video
https://www.youtube.com/watch?v=Bv87lHdS770&ab_channel=TEMMIEHOIHOI
#include <iostream>
#include "myMotionTestCode.hpp"
using namespace std;
using namespace Catoms3D;
int main(int argc, char **argv) {
try {
createSimulator(argc, argv, MyMotionTestCode::buildNewBlockCode);
getSimulator()->printInfo();
BaseSimulator::getWorld()->printInfo();
deleteSimulator();
} catch(std::exception const& e) {
cerr << "Uncaught exception: " << e.what();
}
return 0;
}
#ifndef myMotionTestCode_H_
#define myMotionTestCode_H_
#include "robots/catoms3D/catoms3DSimulator.h"
#include "robots/catoms3D/catoms3DWorld.h"
#include "robots/catoms3D/catoms3DBlockCode.h"
using namespace Catoms3D;
class MyMotionTestCode : public Catoms3DBlockCode {
private:
Catoms3DBlock *module = nullptr;
public :
MyMotionTestCode(Catoms3DBlock *host);
~MyMotionTestCode() {};
Cell3DPosition targetPos;
/**
* This function is called on startup of the blockCode, it can be used to perform initial
* configuration of the host or this instance of the program.
* @note this can be thought of as the main function of the module
*/
void startup() override;
/**
* @brief Provides the user with a pointer to the configuration file parser, which can be used to read additional user information from each block config. Has to be overridden in the child class.
* @param config : pointer to the TiXmlElement representing the block configuration file, all information related to concerned block have already been parsed
*
*/
void parseUserBlockElements(TiXmlElement *config) override;
/**
* @brief Callback function executed whenever the module finishes a motion
*/
void onMotionEnd() override;
/*****************************************************************************/
/** needed to associate code to module **/
static BlockCode *buildNewBlockCode(BuildingBlock *host) {
return(new MyMotionTestCode((Catoms3DBlock*)host));
}
/*****************************************************************************/
};
#endif /* myMotionTestCode_H_ */
#include "myMotionTestCode.hpp"
MyMotionTestCode::MyMotionTestCode(Catoms3DBlock *host) : Catoms3DBlockCode(host), module(host)
{
// @warning Do not remove block below, as a blockcode with a NULL host might be created
// for command line parsing
if (not host)
return;
}
void MyMotionTestCode::startup()
{
console << "start " << module->blockId << "\n";
if (module->blockId == 11)
{ // Master id is 1
module->setColor(RED);
Cell3DPosition target_pos = module->position + Cell3DPosition(-1, -1, -1);
module->moveTo(target_pos);
}
}
void MyMotionTestCode::parseUserBlockElements(TiXmlElement *config)
{
const char *attr = config->Attribute("leader");
if (attr != nullptr)
{
std::cout << module->blockId << " is leader!" << std::endl; // complete with your code
}
}
void MyMotionTestCode::onMotionEnd()
{
// complete with your code
console << " End of motion to " << module->position << "\n";
}
<?xml version="1.0" standalone="no" ?>
<world gridSize="30,30,30" windowSize="1024,800">
<camera target="70.3487,55.9268,21.9671" directionSpherical="-2522.68,37.2878,120" angle="45.000000" near="0.100000" far="2000.000000" />
<spotlight target="0,0,0" directionSpherical="135,80,800" angle="51.340192" />
<blockList blockSize="10,10,10">
<block position="5,5,0" color="255,140,0" orientation="0" />
<block position="5,6,0" color="255,140,0" orientation="0" />
<block position="6,6,0" color="255,140,0" orientation="0" />
<block position="6,5,0" color="255,140,0" orientation="0" />
<block position="6,5,1" color="255,140,0" orientation="0" />
<block position="6,4,1" color="255,140,0" orientation="0" />
<block position="6,6,1" color="255,140,0" orientation="0" />
<block position="5,6,1" color="255,140,0" orientation="0" />
<block position="4,6,1" color="255,140,0" orientation="0" />
<block position="4,5,1" color="255,140,0" orientation="0" />
<block position="6,6,2" color="255,140,0" orientation="0" />
</blockList>
</world>
Hi!
I have found hidden context submenu can be clicked.
This should be bug, please check it?
VisbleSim Version(branch)
VS2022.3.1
Hi!
When I tried to insert a block using the context menu, I was confronted with the error message Trying to insert a block on non-empty cell
. The process is,
Uncaught exception: Trying to insert a block on non-empty cell at (15,15,15)
I think the menu should be closed once another block is selected, so that this bug will be fixed.
Hi!
I found a module on the edge of wall is sink in.
This will occur only on the wall in the photo where the module is sink in.
Just an apparent issue, but odd, so could you check it?
<?xml version="1.0" standalone="no" ?>
<world gridSize="10,10,10" windowSize="1848,1016">
<camera target="54.5554,56.3875,22.0596" directionSpherical="-2561.64,33.8501,220" angle="45.000000" near="0.100000" far="2000.000000" />
<spotlight target="0,0,0" directionSpherical="135,80,800" angle="51" />
<blockList blockSize="10,10,10">
<block position="9,5,1" color="255,140,0" orientation="0" />
<block position="9,4,1" color="255,140,0" orientation="0" />
<block position="0,9,1" color="255,140,0" orientation="0" />
<block position="1,9,1" color="255,140,0" orientation="0" />
<block position="1,5,9" color="255,140,0" orientation="0" />
<block position="1,4,9" color="255,140,0" orientation="0" />
</blockList>
</world>
Hi!
I found deprecated config tag is generated at config generator in context menu.
I think this needs to be fixed, could you please check it?
<?xml version="1.0" standalone="no" ?>
<world gridSize="5,5,6" windowSize="1280,720">
<camera target="25,20,10" directionSpherical="0,30,100" angle="30.000000" near="1.000000" far="300.000000" />
<spotlight target="25,25,0" directionSpherical="-35,40,150" angle="45.000000" />
<blockList blockSize="10,10,10">
<block position="0,0,0" color="128,128,64" orientation="0" />
<block position="1,0,0" color="128,128,64" orientation="0" />
</blockList>
</world>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.