-
Notifications
You must be signed in to change notification settings - Fork 44
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
Icub dev #241
Open
omareldardear
wants to merge
26
commits into
cram2:dev
Choose a base branch
from
omareldardear:icub_dev
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Icub dev #241
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
5dca4e7
[TestMultiverse] Fix when multiverse is not found.
omareldardear 6a15414
[adding iCub] first test for robot description
omareldardear c083502
[development] first valid test on icub (looking)
omareldardear 0632c6c
[feature] icub processing module add move joints motion action
omareldardear be79bf2
[feature] first test icub on pybullet
omareldardear 3a0f739
[iCub] (WIP) added update part to robot description.
omareldardear 0a788fc
[iCub] updating robot description to include actuated joints
omareldardear 316e7a1
[iCub] updating robot description to include fingers and left camera
omareldardear b0a980e
[iCub] radian angles - meshes scale - using default simulation method…
omareldardear 6083ad7
[iCub] updating real robot states using yarp updater
omareldardear 087d86d
[iCub] updating real robot states using yarp updater with fingers
omareldardear 05d791c
[iCub] adding gripper close and open fuctionalities in both real and …
omareldardear 8b305fb
Merge branch 'dev' of github.com:cram2/pycram into icub_dev
omareldardear be8500b
[iCub] rename test
omareldardear 9b62853
clean up
omareldardear 7ba39af
[iCub] adding failure and logging correctly
omareldardear 13e8c5b
[iCub] minor refactoring
omareldardear 9a3b7e3
[iCub] minor refactoring and documentation
omareldardear 8124de0
Merge branch 'dev' into icub_dev
omareldardear ec1fdb5
[iCub] fix
omareldardear 837e4aa
resolve conflicts
omareldardear abd246c
Merge remote-tracking branch 'original_pycram/dev' into icub_dev
omareldardear 2a07761
[iCub] by pass yarp
omareldardear 3da3b33
[iCub] minor structure and documentation changes
omareldardear 949efc0
[iCub] minor fix
omareldardear c78f026
add icub demo
omareldardear File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
from typing_extensions import Tuple,Optional | ||
|
||
from pycram.ros.logging import logwarn | ||
|
||
try: | ||
import yarp | ||
except ImportError: | ||
logwarn("yarp wasn't found, please check the installation") | ||
|
||
if yarp is not None: | ||
|
||
ACK_VOCAB = yarp.createVocab32('a','c','k') | ||
NO_ACK_VOCAB = yarp.createVocab32('n','a','c','k') | ||
|
||
|
||
def init_yarp_network(): | ||
""" | ||
Initializes the YARP network. | ||
|
||
:param func: Function that should be thread safe | ||
:return bool -> true if the YARP network is successfully initialized. | ||
""" | ||
if not yarp.Network.checkNetwork(): | ||
print("Unable to find a yarp server exiting ...") | ||
return False | ||
|
||
yarp.Network.init() | ||
return True | ||
|
||
def open_rpc_client_port(port_name:str)->Tuple[bool, Optional[yarp.RpcClient]]: | ||
""" | ||
Opens a YARP RpcClient port with the specified name. | ||
|
||
:param `port_name` (str): The name of the RPC client port to be opened. | ||
:return Tuple: (bool ( success/ fail ), yarp.RpcClient or None) | ||
""" | ||
handle_port: yarp.RpcClient = yarp.RpcClient() | ||
if not handle_port.open(port_name): | ||
print(f"Can't open the port %s correctly" % port_name) | ||
return False , None | ||
print(f"Port %s opened correctly" % port_name) | ||
return True , handle_port | ||
|
||
def open_buffered_bottle_port(port_name:str)->Tuple[bool, Optional[yarp.BufferedPortBottle]]: | ||
""" | ||
Opens a YARP BufferedPortBottle with the specified port name. | ||
|
||
:param `port_name` (str): The name of the port to be opened. | ||
:return Tuple: (bool ( success/ fail ), yarp.BufferedPortBottle or None) | ||
""" | ||
opened_port: yarp.BufferedPortBottle = yarp.BufferedPortBottle() | ||
if not opened_port.open(port_name): | ||
print(f"Can't open the port %s correctly" % port_name) | ||
return False , None | ||
print(f"Port %s opened correctly" % port_name) | ||
return True , opened_port | ||
|
||
|
||
def interrupt_and_close(m_module:yarp.RFModule): | ||
""" | ||
interrupt and close the module | ||
:param m_module: yarp module | ||
""" | ||
m_module.interruptModule() | ||
m_module.close() | ||
print("iCub state updater closed") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 exit method for Process modules is a nice idea.
But the actual code to exit the connection to a robot should be directly in the Process module.
Please also add an exit method to the ProcessModule parent class and then call the currently loaded ProcessModule.exit method from this method
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.
isn't this what i did ?
Would you explain more this part
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.
Yes what you did is correct, I was just confused about the structure of the ProcessModuleManager