Skip to content
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

469 task rewrite thruster interface #492

Merged
merged 57 commits into from
Nov 17, 2024

Conversation

albertomors
Copy link

No description provided.

albertomors and others added 9 commits September 27, 2024 18:33
…erly. I still have to figure out how to remove default initialization class field from the header file. Apparently the code was relying on default values for default constructor and so on on multiple levels, including constructor default values, class default values, declare_parameter default values creating a total mess. Removed almost all of them, i'm not able to remove the last one: driver class default params. If I do, i get a compilation error saying that my constructor called from outside doesnt match with the constructor specified in the class? idk. But somehow executes my constructor because substitutes the default values, but if i call only mine, doesnt compile. BOH. Mi sa che vado a letto ciao.
Copy link
Contributor

@Andeshog Andeshog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the python package and change the name of the new cpp package back to the original name

@jorgenfj
Copy link

Also update the thrust_update_rate: 10.0 # [Hz] in orca.yaml
Should be higher than 10.0

Copy link
Member

@chrstrom chrstrom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass of the C++ stuff.

As a general note, you might want to remove most of the inline comments. As a general rule of thumb, you should have a very good reason for adding inline codes (if you can't avoid some bit magic or some specific equation etc), as the code itself should do the explaining: Comments may lie (and/or become outdated), but the code wont!

This can most notably be seen in the suggestions to use std::algorithm, as that makes things a lot more explicit (especially when defining the lambdas outside the algorithm call and giving it a fitting name!

Also note that the suggestions here are free-balled, so make sure everything compiles and works as expected 😅

@jorgenfj jorgenfj linked an issue Oct 24, 2024 that may be closed by this pull request
3 tasks
Copy link
Contributor

@Andeshog Andeshog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there now. As mention in one of the comments I think it will be a good idea to remove the timer callback and just send pwm in the thruster_forces subscriber callback instead. The cpp part looks good enough for me, but I will let @chrstrom be the final judge for that.

Copy link

@jorgenfj jorgenfj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I unresolved the comment regarding the debug publisher from my previous review. The publisher should only publish when we actually want to debug.

Also I had to include:
#include
#include

in order to compile pwm_to_i2c_data

I got this error squiggle in vscode:
function "ThrusterInterfaceAUVDriver::pwm_to_i2c_data" returns incomplete type "std::array<uint8_t, 2UL>" (aka "std::array<unsigned char, 2UL>")C/C++(409)

Although seems like the automated build process didn't encounter this so not sure if it should be a concern

Copy link
Contributor

@Andeshog Andeshog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aim to test the code on Orca on Friday or Sunday and then merge into develop after

motion/thruster_interface_auv/README.md Outdated Show resolved Hide resolved
motion/thruster_interface_auv/package.xml Outdated Show resolved Hide resolved
@albertomors albertomors requested a review from Andeshog November 17, 2024 14:14
@Andeshog Andeshog merged commit 363078f into develop Nov 17, 2024
2 checks passed
@Andeshog Andeshog deleted the 469-task-rewrite-thruster-interface branch November 17, 2024 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TASK] Rewrite Thruster Interface
5 participants