Closed Bdelspi closed 4 years ago
Has anyone been able to/ seen modern examples of how to control their motoman via matlab?
Currently:
- MATLAB 2019b with -- robotics toolbox --ROS toolbox
- YRC1000micro -GP8 manipulator
Running through the workflow, I am able to make connection with the YRC1000micro and ROS via rosint (confirmed through pinging the robot and executing rosparam list).
Our obstacle is in initiating robot motion, for example when running rostopic /joint_trajectory_action, MATLAB returns The "/joint_trajectory_action" operation is not supported.
Any suggestions? Is their Motoman support in Matlab? For example, like the Kuka sunrise toolbox for the Kuka robots...
Also, the following show as available in MATLAB. However, not all seem to be supported...
The packages in this repository support a regular ROS API for robot drivers (such as a JointState
s topic and a FollowJointTrajectory
action server).
If those can be used from Matlab, you should be able to control the robot.
There is no specific support for Matlab here.
You'll have to use the same topics, services and actions as you would from a ROS node without Matlab.
The easiest would probably be to send a properly setup FollowJointTrajectory
action goal. You could refer to #229, which links to an example action client that shows how such a goal could be setup and submitted.
I don't know whether Matlab supports action clients. If it does, you should be able to duplicate what the example does. If it doesn't, things are going to become more difficult.
In any case: only trajectory execution is supported (by default). No direct streaming of jointstates/setpoints.
As this is not an issue with the packages in this repository (but a configuration/integration issue on the user's side), I'm going to close this.
Feel free to keep commenting on the issue of course.
Some observations:
rostopic /joint_trajectory_action
that is not a valid rostopic
command line. So the problem is with how rostopic
is invoked. Not with motoman_driver
.
rostopic echo /joint_trajectory_action
This is also not a valid rostopic
command line, as /joint_trajectory_action
is the base namespace of the FollowJointTrajectory
action server. rostopic
cannot echo
namespaces, only topics.
Furthermore, only certain topics in that namespace would publish something.
As this is not an issue with the packages in this repository (but a configuration/integration issue on the user's side), I'm going to close this.
Feel free to keep commenting on the issue of course.
@gavanderhoorn Thank you for all your help with this! Yeah, I have been unable to find a suggested workflow for integrating existing ROS industrial workpackages into Matlab and am working on creating one. As pointed out by Safeea and Neto for their Kuka sunrise toolbox having a Matlab interface could enable robotic applications to those with basic Matlab skills, even if they are not programming experts...
Thank you again for all your help with this gavanderhoorn!
Well as I wrote, if Matlab supports actionlib
, interfacing with the driver would be as simple as populating a FollowJointTrajectory
goal and submitting it to the driver.
A quick Google suggests it does support actionlib
: Creating ROS action client, so this should be possible. sendGoal(..) should be used to submit the goal to the server.
Be sure to call the enable_robot
server before sending the goal, or otherwise it'll be returned with a FAIL
immediately.
@gavanderhoorn you are awesome! Thank you so much! Yeah, I think the obstacle is stemming from the need to create ROS custom messages in Matlab (since for example FollowJointTrajectory is not supported by Matlab out-of-the-box), and have been learning about these today. My plan is to implement this tomorrow and will keep you up to date as we progress.
Thank you again for all that you do gavanderhoorn!
@gavanderhoorn
Hi, gavanderhoorn: Thanks for your reply to this issue. In my understanding, the motorman driver is the package that can encode and decode the control information into some data that YRC100 can receive. And we can use ROS to establish the connection between our host computer and the controller box(YRC 1000). In a Linux terminal we can establish the connection through the IP address of the robot. And we can enable or disable the controller through "rosservice call /robot_enable". As you mentioned in this terminal, we can see the rosservice list through the Matlab command line, and find /robot_enable inside it. But it will return us
Cannot find a MATLAB message class for type std_srvs/TriggerRequest.
I think that's because Matlab cannot support type in C++, so we cannot enable robot and sent the message through Matlab.
Do you have any idea about that?
Thanks, Gloria
In my understanding, the motorman driver is the package that can encode and decode the control information into some data that YRC100 can receive.
That is roughly what it does, yes.
And we can use ROS to establish the connection between our host computer and the controller box(YRC 1000).
To be precise: no, ROS is not used between the YRC and the ROS PC. A different communications protocol is used there.
In a Linux terminal we can establish the connection through the IP address of the robot. And we can enable or disable the controller through "rosservice call /robot_enable". As you mentioned in this terminal, we can see the rosservice list through the Matlab command line, and find /robot_enable inside it. But it will return us
Cannot find a MATLAB message class for type std_srvs/TriggerRequest.
I think that's because Matlab cannot support type in C++
If with "type in C++" you are referring to messages/services and/or actions, then I believe there may be a misunderstanding: ROS messages are not specific to any particular language. The .msg
, .srv
and .action
format is a custom format, plain text. Only after being processed by a code generator (ie: gencpp
, genpy
et al) do we get their representation in a specific programming language.
so we cannot enable robot and sent the message through Matlab.
For matlab, you'll have to figure out how to make it use certain messages or services. The specific error message you show seems to indicate that there is no support for std_srvs/Trigger (or you have not configured things correctly). This particular service is part of the std_srvs
package, which is a core ROS package. I would be surprised if Mathworks has not built in support for those services.
Call and Provide ROS Services in the matlab documentation seems to be what you need to do, but with the appropriate service type of course.
As I wrote earlier: I have no experience with Matlab and ROS. I just googled for 5 minutes with some keywords.
I would recommend you ask Mathworks support to help you in this case. In the end, all you need to do is call a service and submit an action goal (with a trajectory). There is no requirement for C++ (or any other programming language outside of what Matlab can already do).
Note that for all of the above to work, you'll still need a Linux machine running motoman_driver
and the rest of the required nodes.
And just to repeat myself as a form of expectation management:
In any case: only trajectory execution is supported (by default). No direct streaming of jointstates/setpoints.
Don't expect real-time control of the robot (a la simulink/xpc).
That's not what the driver allows.
Thank you @gavanderhoorn, we have reached out to Mathworks and have been working with them, but have been unable to reach a resolution on this. We will keep you up to date as we progress. Thank you again for all your help!
I'm a bit surprised Mathworks is having such a hard time supporting you in calling a service with a type from std_srvs
and/or submitting an action goal also from a standard ROS package.
Has anyone been able to/ seen modern examples of how to control their motoman via matlab?
Currently:
Running through the workflow, I am able to make connection with the YRC1000micro and ROS via rosint (confirmed through pinging the robot and executing rosparam list).
Our obstacle is in initiating robot motion, for example when running rostopic /joint_trajectory_action, MATLAB returns The "/joint_trajectory_action" operation is not supported.
Any suggestions? Is their Motoman support in Matlab? For example, like the Kuka sunrise toolbox for the Kuka robots...