-
Notifications
You must be signed in to change notification settings - Fork 14
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
Mnaveau/use shared pointer #2
Conversation
Thanks for your changes @MaximilienNaveau . After compiling and sourcing the workspace, I am getting this error: $ ipython
In [1]: run demo_solo12.py
if_name: enp5s0f1
Using Ethernet (enp5s0f1)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
~/dev/blmc_testing/workspace/src/odri_control_interface/demos/demo_solo12.py in <module>
23 # Read the values once here. The returned values are views on the data and
24 # update after the call to `robot.parse_sensor_data()`.
---> 25 imu_attitude = robot.imu.attitude_euler
26 positions = robot.joints.positions
27 velocities = robot.joints.velocities
TypeError: No Python class registered for C++ class std::shared_ptr<odri_control_interface::IMU>
|
Ok I know what the problem is |
This commit should fix the issue, sorry that was a dumb mistake. |
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.
Thanks for the changes!
Did you check if the code works with the python bindings/python examples? Should I try it on the real robot?
double safety_damping | ||
); | ||
JointModules(const std::shared_ptr<MasterBoardInterface>& robot_if, | ||
ConstRefVectorXi motor_numbers, |
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.
Did you check if the python bindings work? I had troubles when I wanted to use the integers before as it looks like the python binding was expecting long as type. That's why I implemented the motor_numbers as RefVectorX[l]
before.
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.
Ok you should try it and let me know if the python bindings are working or not.
If not I will provide a setter/accessor for VectorXl
in the python bindings
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.
The yaml parsing goes well and the objects are returned properly in python at least.
I am checking the construction of the robot by hand.
Trying the latest branch, I am getting this error now:
|
@jviereck can you check again? |
With the above change (see last commit from me) I am able to run the python example on the real robot! |
Cool, python bindings are working, hence we need to figure out why the imu is buggy on bolt. |
Shall this PR be merged already or do you want to figure out what's the problem on bolt first? |
I want to know if the imu behavior comes from the |
Things work fine on bolt Debug and Release! |
…network interface.
…Xd&` and copy_const_ref in `boost::python`
…copy_const_reference
87a33ee
to
e394523
Compare
Description
Modify the API to use std::shared_ptr. This should prevent potential memory missuses.
How I Tested
I import the python bindings and tested the addresses.
TODO test on a real robot!
I fulfilled the following requirements