-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for writing systems in Python #2045
Add support for writing systems in Python #2045
Conversation
Signed-off-by: Addisu Z. Taddese <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Voldivh <[email protected]>
Signed-off-by: Voldivh <[email protected]>
This allows multiple PythonSystemLoaders to run albeit with a single python interpreter. Signed-off-by: Addisu Z. Taddese <[email protected]>
…nto python_systems
Signed-off-by: Addisu Z. Taddese <[email protected]>
Signed-off-by: Addisu Z. Taddese <[email protected]>
@@ -0,0 +1,23 @@ | |||
from gz.sim8 import UpdateInfo, EntityComponentManager, Model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LICENSE
<world name="python_system"> | ||
|
||
|
||
<light type="directional" name="sun"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<world name="python_system"> | |
<light type="directional" name="sun"> | |
<world name="python_system"> | |
<light type="directional" name="sun"> |
@@ -22,11 +22,15 @@ | |||
#include <gz/msgs/server_control.pb.h> | |||
#include <gz/msgs/stringmsg_v.pb.h> | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
gzerr << "Error while loading module 'sys'\n" | ||
<< _err.what() << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gzerr << "Error while loading module 'sys'\n" | |
<< _err.what() << std::endl; | |
gzerr << "Error while loading module 'sys'\n" | |
<< _err.what() << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple of minor comments. This looks good! Is it ready to try it out? @azeey
@@ -22,11 +22,15 @@ | |||
#include <gz/msgs/server_control.pb.h> | |||
#include <gz/msgs/stringmsg_v.pb.h> | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove?
{ | ||
_method(std::forward<Args>(_args)...); | ||
} | ||
catch (const pybind11::error_already_set &_err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
catch (const pybind11::error_already_set &_err) | |
catch (const py::error_already_set &_err) |
Yes, I have an example with some instructions. |
// TODO (azeey) Improve formatting. | ||
gzdbg << py::str(searchPaths).cast<std::string>() << std::endl; | ||
} | ||
catch (const pybind11::error_already_set &_err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
catch (const pybind11::error_already_set &_err) | |
catch (const py::error_already_set &_err) |
{ | ||
this->pythonModule = py::module_::import(moduleName.c_str()); | ||
} | ||
catch (const pybind11::error_already_set &_err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
catch (const pybind11::error_already_set &_err) | |
catch (const py::error_already_set &_err) |
} | ||
this->pythonSystem = getSystem(); | ||
} | ||
catch (const pybind11::error_already_set &_err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
catch (const pybind11::error_already_set &_err) | |
catch (const py::error_already_set &_err) |
7bf6366
to
30439ab
Compare
7998bf7
to
af115a1
Compare
It seems that github automatically closed this PR because the branch it was targeting was deleted. I'm also not able to reopen it, so I'll create a new PR. |
🎉 New feature
Closes #790
Summary
Test it
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.