Page 1 of 1

Ros2-CoppeliaSim and some bug.

Posted: 13 Mar 2024, 09:16
by fairytalef00
Hello.

I'm struggling to build a connection environment between Ros2 and CoppeliaSim.

To describe the current situation,
First, I have a randomly created rotating robot with 'dynamic mode' for the joints.
Also, the control mode is 'custom'.
Similarly, the other links have mass and inertia.

The revolute joint (subscriber) in coppeliaSim receives topic(angle) from the publisher, and we want the joint to adjust its rotation angle.
Like every second pi/10, pi/20, pi/30 ... (excel file content. row 1, row 2, row 3, ...) and so on.

So I made an external publisher (python) to send topic(angle) every second down 1 row of excel file contents.

I thought the revolute joint(subscriber) would then adjust the angle as it receives the topic, but I get an error where it adjusts and then repositions back to the original angle.

I'm attaching the script for the joint, as well as a video of the error.

https://1drv.ms/f/s!AuvU7BTQNjpWh_Vem8H ... w?e=vaajZM

What could be the problem?



Thank you.

Re: Ros2-CoppeliaSim and some bug.

Posted: 15 Mar 2024, 19:54
by coppelia
Hello,

from the video, it looks like the joint gets target positions from two different sources. Best would be if you shared the scene file, so that we could have a closer look at it.

Cheers

Re: Ros2-CoppeliaSim and some bug.

Posted: 18 Mar 2024, 11:23
by fairytalef00
Thank you for reply.

https://1drv.ms/f/s!AuvU7BTQNjpWh_Vem8H ... w?e=2afGAb

There are my files(scene, video. etc) about this test.

Re: Ros2-CoppeliaSim and some bug.

Posted: 18 Mar 2024, 17:15
by coppelia
So you have several problems in that scene:
  • The upper and lower cuboids are colliding and friction between them may influence the motion. Make sure that either they are not colliding, or that the upper cuboid is not respondable (or does not generate a collision response with the lower cuboid)
  • Since your joint is dynamic, you should use sim.setJointTargetPosition, not sim.setJointPosition
  • Your joint is in custom control mode, but there is no sysCall_joint callback function. Just set the joint into force control mode.
Cheers

Re: Ros2-CoppeliaSim and some bug.

Posted: 20 Mar 2024, 09:41
by fairytalef00
Thank you so much.

This has helped me a lot