Robotics StackExchange | Archived questions

Using sensor_msgs/JointState in the newly released rosmatlab my MathWorks

I recently installed the rosmatlab package from Mathworks. I am trying to create a msg of type sensormsgs/JointState as follows, msg = rosmatlab.message('sensormsgs/JointState', node)

given that roscore and node are already defined.

I am then using

msg.setName('something')

I am getting the following error

No method 'setName' with matching signature found for class 'org.ros.internal.message.$Proxy23'.

I cannot find the documentation for msg.setName to look for the funcitons arguments.

I can however call

msg.setPosition(21) and msg.setVelocity as expected.

Please help

Asked by Adnan Munawar on 2014-02-09 09:13:39 UTC

Comments

Hi, the solution is on : https://de.mathworks.com/matlabcentral/answers/130611-ros-matlab-i-o-joint_state-publisher. Matlab version 2017a. Thanks!

Asked by ViktorDluhos on 2017-08-17 10:10:33 UTC

As you already note on your answer on Matlab Central, the current ROS support in the Robotics toolbox of Mathworks is rather different from the rosmatlab pkg that the OP was using. I'm not sure the answer is 'portable'.

Asked by gvdhoorn on 2017-08-17 14:12:42 UTC

Well, yes I told that I have newer version but the solution is revelant to the question. So if someone will have this problem in the future and he will have a newer version of matlab, he will find his solution here. The point is to create Cell Array od strings (then you can use it to set parameter)

Asked by ViktorDluhos on 2017-08-17 14:41:00 UTC

But if you think that the solution isnt relevantné enough then you Can delete my answer. I just wanted to help dome people. Best regards.

Asked by ViktorDluhos on 2017-08-17 14:42:43 UTC

I thought the question was referring to tu-darmstadt-ros-pkg/rosmatlab, which has the same name, but is not from Mathworks.

I'm not going to delete anything. I was merely wondering whether the same software was being referenced.

Asked by gvdhoorn on 2017-08-17 14:45:09 UTC

Well yes I agree with you. Im not entirely sure if it could work on rosmatlab. Im current working onconnection ROS with Matlab and I Washington havinka the samé problém and couldnt fond the answer anuwhere. So I just shared what I found out.

Asked by ViktorDluhos on 2017-08-17 14:50:42 UTC

Answers