lardemua / atlascar2

Core packages for the LAR DEMUA Atlas Project
6 stars 1 forks source link

Interactive pattern wrong reference frame #45

Open Rafafbo opened 6 months ago

Rafafbo commented 6 months ago

Hey, In order to get better collections for calibration purposes, I'm trying to record the rosbag while changing the pattern's position and orientation in Rviz. For that matter, i see that in the interactive_pattern node gets the pattern pose relative to 'world' frame and sets the f feedback pose from Rviz to the same frame. I checked the TF tree and the frame in gazebo is 'odom': image I tried changing 'world' to 'odom' in the 3rd line in code-snippet but it failed rospy.wait_for_service('/gazebo/get_model_state') get_model_state_service = rospy.ServiceProxy('/gazebo/get_model_state', GetModelState) pose_gazebo = get_model_state_service(model_name, 'world') status_message: "GetModelState: reference relative_entity_name not found, did you forget to scope\ \ the body by model name?"

Since there is no world frame in Rviz as well, i set the iterative marker.header.frame_id = 'odom' which works, when moving it in Rviz it also moves in gazebo but, as expected, the poses don't match: image Any idea on how to solve this?

miguelriemoliveira commented 6 months ago

Hi @Rafafbo ,

you should mention the code which you changed, like this:

https://github.com/lardemua/atom/blob/d6f163712974654dd1620c2a94743eea8ef798be/atom_calibration/package.xml#L12-L18

That way it is easier to understand ...

miguelriemoliveira commented 6 months ago

I would check the car xacro definition, in particular the place where hodometry is defined. There should be a way to define the name of the odom frame and change it to world.

In any case @manuelgitgomes will know more about this than me ...

Rafafbo commented 6 months ago

Hi @Rafafbo ,

you should mention the code which you changed, like this:

https://github.com/lardemua/atom/blob/d6f163712974654dd1620c2a94743eea8ef798be/atom_calibration/package.xml#L12-L18

That way it is easier to understand ...

Noted!

I would check the car xacro definition, in particular the place where hodometry is defined. There should be a way to define the name of the odom frame and change it to world.

In any case @manuelgitgomes will know more about this than me ...

Yes, I checked it and didn't see any definition of the odom or the world frame.

miguelriemoliveira commented 6 months ago

Perhaps this

https://github.com/lardemua/atlascar2/blob/ef7ae5f5ae60637faa54be49856dc73d791db19f/atlascar2_description/config/atlascar2_steering_params_odom.yaml#L33

But only @manuelgitgomes will be able to help. He is quite busy now so probably will only reply next week...

manuelgitgomes commented 6 months ago

Hello @Rafafbo.

Honestly, I am not certain how I did this and, as @miguelriemoliveira stated, I do not have the time to delve into this right now.

However, I found this: https://github.com/lardemua/atlascar2/blob/ef7ae5f5ae60637faa54be49856dc73d791db19f/atlascar2_bringup/launch/ackermann_bringup.launch#L16-L22

When calibrating, for some reason, I use different parameters. Are you setting the arg calibration as true when launching?

Rafafbo commented 6 months ago

Hello @manuelgitgomes

Yes, I tried but same issue with other frames and i don't understand why you made this transform: https://github.com/lardemua/atlascar2/blob/ef7ae5f5ae60637faa54be49856dc73d791db19f/atlascar2_odom/nodes/model_states_to_odomtf.py#L23-L27 Anyway, don't worry about it now because I found another way to get good collections!