Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interactive pattern wrong reference frame #45

Open
Rafafbo opened this issue Feb 22, 2024 · 6 comments
Open

Interactive pattern wrong reference frame #45

Rafafbo opened this issue Feb 22, 2024 · 6 comments

Comments

@Rafafbo
Copy link
Collaborator

Rafafbo commented Feb 22, 2024

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
Copy link
Member

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
Copy link
Member

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
Copy link
Collaborator Author

Rafafbo commented Feb 22, 2024

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
Copy link
Member

Perhaps this

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

@manuelgitgomes
Copy link
Collaborator

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:

<group if="$(arg calibration)">
<node name="model_states_to_tf" pkg="atlascar2_odom" type="model_states_to_odomtf.py"/>
<node name="controller_spawner" pkg="controller_manager" type="spawner"
args="$(find atlascar2_description)/config/atlascar2_steering_params.yaml">
</node>
</group>

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

@Rafafbo
Copy link
Collaborator Author

Rafafbo commented Feb 23, 2024

Hello @manuelgitgomes

Yes, I tried but same issue with other frames and i don't understand why you made this transform:

br = tf2_ros.TransformBroadcaster()
t = TransformStamped()
t.header.stamp = rospy.Time.now()
t.header.frame_id = 'odom'
t.child_frame_id = 'base_footprint'

Anyway, don't worry about it now because I found another way to get good collections!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants