Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
including LCM-Foxglove bridge functionality and LCM message definitions.
"""

__version__ = "0.1.0"
# Keep in sync with [project].version in pyproject.toml
__version__ = "0.1.4"

import os
import sys
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,21 @@ rm -rf "$SCRIPT_DIR/generated/lua_lcm_msgs"
echo -e "\033[32mLCM -> Lua done\033[0m"

# Generate TypeScript bindings
rm -rf "$SCRIPT_DIR/generated/ts_lcm_msgs"
# Only the per-package directories are generated; anything else in there is
# hand-written, so clear the packages instead of the whole tree.
mkdir -p "$SCRIPT_DIR/generated/ts_lcm_msgs"
find "$SCRIPT_DIR/generated/ts_lcm_msgs" -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} +
deno run --allow-read --allow-write "$SCRIPT_DIR/tools/ts/gen/mod.ts" -q -o "$SCRIPT_DIR/generated/ts_lcm_msgs" "$SCRIPT_DIR/lcm_types"/*.lcm
# Copy to msgs package (for JSR publishing - symlinks not supported)
rm -rf "$SCRIPT_DIR/tools/ts/msgs/generated"
cp -r "$SCRIPT_DIR/generated/ts_lcm_msgs" "$SCRIPT_DIR/tools/ts/msgs/generated"
mkdir -p "$SCRIPT_DIR/tools/ts/msgs/generated"
cp -r "$SCRIPT_DIR/generated/ts_lcm_msgs"/*/ "$SCRIPT_DIR/tools/ts/msgs/generated/"
echo -e "\033[32mLCM -> TypeScript done\033[0m"

# Generate Rust bindings
rm -rf "$SCRIPT_DIR/generated/rust_lcm_msgs"
# The generator owns src/ and Cargo.toml; tests/, Cargo.lock and .gitignore are
# hand-written, so only clear src/ rather than the whole crate.
rm -rf "$SCRIPT_DIR/generated/rust_lcm_msgs/src"
python3 "$SCRIPT_DIR/tools/rust/lcm_rust_gen.py" "$SCRIPT_DIR/lcm_types" -o "$SCRIPT_DIR/generated/rust_lcm_msgs"
(cd "$SCRIPT_DIR/generated/rust_lcm_msgs" && cargo check --quiet)
echo -e "\033[32mLCM -> Rust done\033[0m"
168 changes: 168 additions & 0 deletions generated/cpp_lcm_msgs/geographic_msgs/BoundingBox.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
/** THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT MODIFY
* BY HAND!!
*
* Generated by lcm-gen 1.5.2
**/

#ifndef __geographic_msgs_BoundingBox_hpp__
#define __geographic_msgs_BoundingBox_hpp__

#include <lcm/lcm_coretypes.h>

#include "geographic_msgs/GeoPoint.hpp"
#include "geographic_msgs/GeoPoint.hpp"

namespace geographic_msgs
{

class BoundingBox
{
public:
geographic_msgs::GeoPoint min_pt;

geographic_msgs::GeoPoint max_pt;

public:
/**
* Encode a message into binary form.
*
* @param buf The output buffer.
* @param offset Encoding starts at thie byte offset into @p buf.
* @param maxlen Maximum number of bytes to write. This should generally be
* equal to getEncodedSize().
* @return The number of bytes encoded, or <0 on error.
*/
inline int encode(void *buf, int offset, int maxlen) const;

/**
* Check how many bytes are required to encode this message.
*/
inline int getEncodedSize() const;

/**
* Decode a message from binary form into this instance.
*
* @param buf The buffer containing the encoded message.
* @param offset The byte offset into @p buf where the encoded message starts.
* @param maxlen The maximum number of bytes to read while decoding.
* @return The number of bytes decoded, or <0 if an error occured.
*/
inline int decode(const void *buf, int offset, int maxlen);

/**
* Retrieve the 64-bit fingerprint identifying the structure of the message.
* Note that the fingerprint is the same for all instances of the same
* message type, and is a fingerprint on the message type definition, not on
* the message contents.
*/
inline static int64_t getHash();

/**
* Returns "BoundingBox"
*/
inline static const char* getTypeName();

// LCM support functions. Users should not call these
inline int _encodeNoHash(void *buf, int offset, int maxlen) const;
inline int _getEncodedSizeNoHash() const;
inline int _decodeNoHash(const void *buf, int offset, int maxlen);
inline static uint64_t _computeHash(const __lcm_hash_ptr *p);
};

int BoundingBox::encode(void *buf, int offset, int maxlen) const
{
int pos = 0, tlen;
int64_t hash = getHash();

tlen = __int64_t_encode_array(buf, offset + pos, maxlen - pos, &hash, 1);
if(tlen < 0) return tlen; else pos += tlen;

tlen = this->_encodeNoHash(buf, offset + pos, maxlen - pos);
if (tlen < 0) return tlen; else pos += tlen;

return pos;
}

int BoundingBox::decode(const void *buf, int offset, int maxlen)
{
int pos = 0, thislen;

int64_t msg_hash;
thislen = __int64_t_decode_array(buf, offset + pos, maxlen - pos, &msg_hash, 1);
if (thislen < 0) return thislen; else pos += thislen;
if (msg_hash != getHash()) return -1;

thislen = this->_decodeNoHash(buf, offset + pos, maxlen - pos);
if (thislen < 0) return thislen; else pos += thislen;

return pos;
}

int BoundingBox::getEncodedSize() const
{
return 8 + _getEncodedSizeNoHash();
}

int64_t BoundingBox::getHash()
{
static int64_t hash = static_cast<int64_t>(_computeHash(NULL));
return hash;
}

const char* BoundingBox::getTypeName()
{
return "BoundingBox";
}

int BoundingBox::_encodeNoHash(void *buf, int offset, int maxlen) const
{
int pos = 0, tlen;

tlen = this->min_pt._encodeNoHash(buf, offset + pos, maxlen - pos);
if(tlen < 0) return tlen; else pos += tlen;

tlen = this->max_pt._encodeNoHash(buf, offset + pos, maxlen - pos);
if(tlen < 0) return tlen; else pos += tlen;

return pos;
}

int BoundingBox::_decodeNoHash(const void *buf, int offset, int maxlen)
{
int pos = 0, tlen;

tlen = this->min_pt._decodeNoHash(buf, offset + pos, maxlen - pos);
if(tlen < 0) return tlen; else pos += tlen;

tlen = this->max_pt._decodeNoHash(buf, offset + pos, maxlen - pos);
if(tlen < 0) return tlen; else pos += tlen;

return pos;
}

int BoundingBox::_getEncodedSizeNoHash() const
{
int enc_size = 0;
enc_size += this->min_pt._getEncodedSizeNoHash();
enc_size += this->max_pt._getEncodedSizeNoHash();
return enc_size;
}

uint64_t BoundingBox::_computeHash(const __lcm_hash_ptr *p)
{
const __lcm_hash_ptr *fp;
for(fp = p; fp != NULL; fp = fp->parent)
if(fp->v == BoundingBox::getHash)
return 0;
const __lcm_hash_ptr cp = { p, BoundingBox::getHash };

uint64_t hash = 0xecb7cbaa66bccde0LL +
geographic_msgs::GeoPoint::_computeHash(&cp) +
geographic_msgs::GeoPoint::_computeHash(&cp);

return (hash<<1) + ((hash>>63)&1);
}

}

#endif
Loading