Closed hijimasa closed 3 weeks ago
I found that JointStateSubscriber.cs only accepts a position command. I think JointStateSubscriber should also accept velocity and effort commands.
Hi @hijimasa,
JointStateSubscriber doesn't fetch the velocity and effort data from MessageTypes.Sensor.JointState, but those fields are still present in the base message class, they're just not used. JointStateSubscriber triggers JointStateWriter to update the robot's kinematics. JointStateWriter then triggers the virtual OnUpdateJointStatefrom. The update method is overridden by the specific Unity joint type, continuous, prismatic or revolute. These updates are applied directly to the Unity transform component, not the rigidbody. This is the intended behaviour as JointStateSubsriber is designed for visualisation and kinematics, not simulation.
Updating velocity and effort requires you to manipulate the rigidbody component, as you can only change position and rotation via the transform component. I would not recommend combining the two at runtime as this can lead to unrealistic behaviour.
Please see the message handling wiki page.
"JointState" is the current state of a joint, not it's set point. Nothing remains to simulate here.
Hi @memrecakal , If the velocity and effort data exist in the base message class, shouldn't we use them to simulate them? I just thought that using topic_based_ros2_control would create a better simulation environment, but am I wrong?
Well, if that's how it's designed, so be it. I'll look for another tool.
Here is my question: I'm attempting to simulate a mobile robot using ROS 2 Humble and Unity. I have set up a robot model with reference to the following URL and am trying to make the robot work using Joint State instead of Joy messages, but it is not working. https://github.com/siemens/ros-sharp/wiki/User_App_ROS_TransferURDFFromROS
The using URDF is as follows.
The topic given as command is as follows.
Is there something wrong with the way the commands are given or the robot model is set up?