Contoller in Simulink Matlab 2020b and ROS Melodic

조회 수: 3 (최근 30일)
Ehtisham ul Hasan
Ehtisham ul Hasan 2021년 4월 17일
이동: Remo Pillat 2024년 1월 31일
Hi,
I am implementing a motion controller in Simulink for ROS enabled robot. The simulink model sends joint trajectory message to ROS enabled model in Gazebo. I do not get any error in Matlab or anywhere else but the following lines appear whenever I run my code and no motion takes place in Gazebo.
Server: (argc: 5) (argv[0]: /usr/local/MATLAB/R2020b/toolbox/ros/bin/glnxa64/libmwros1server) started (pid: 3438)
Current directory: "/home/has/simulink_models"
*** Done exchange remaining queues terminating
*** Before cleanup the service:
Server: ending (pid: 3438)
Please advice. Help is requested.
Update: I think the issue is time from start is not mentioned in the Matlab Function block and if I use rosduration, it gives an error that rosduration not supported for code generation (in Simulink). So, I need to know what we can do instead of assigning rosduration(1.0) to TimeFromStart in trajectory_messages/JointTrajectoryPoint in Matlab Function Block in Simulink.
NOTE: I also tried assigning rostime, duration, seconds in double and also in integer data type but no success. Though assigning double data type should work as it is the default used by TimeFromStart but it do not work unfortunately.
Thank you for any help or suggestion in this regard.
Best
Hasan
  댓글 수: 1
Rahul Bhadani
Rahul Bhadani 2021년 5월 3일
I think you should raise a ticket at Service request/bug report for this.

댓글을 달려면 로그인하십시오.

답변 (1개)

Ehtisham ul Hasan
Ehtisham ul Hasan 2021년 5월 4일
이동: Remo Pillat 2024년 1월 31일
Hi,
Thank you for the kind response. There was some hard time understanding how TimeFromStart work. What finally worked is though ROS time block is there but updating it or incrementing it in a for loop or while loop did not work. It is just equivalent to ROS simulation time and will keep on running in the backgeound. To ensure the control command is published to Gazebo model and it does not stop at ROS terminal TImeFromStart seconds field in trajectory_msgs/JointTrajectoryPoint message needs to be filled explicitly keeping ROS time block connected as input to the function block.
Thanks for the support.
Best Regards

카테고리

Help CenterFile Exchange에서 Network Connection and Exploration에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by